summaryrefslogtreecommitdiffstats
path: root/static/functions/script_start.js
diff options
context:
space:
mode:
authorGit <git@what.cd>2013-07-16 08:00:49 +0000
committerGit <git@what.cd>2013-07-16 08:00:49 +0000
commit63f08f0b62e30fa4e99318a11ede8879021efc80 (patch)
tree691096d4e5c91285affb00d01f834da3b9b3a23b /static/functions/script_start.js
parent198cb9c9af6c0838a576b41c890abf7747d202ed (diff)
downloadGazelle-63f08f0b62e30fa4e99318a11ede8879021efc80.zip
Gazelle-63f08f0b62e30fa4e99318a11ede8879021efc80.tar.gz
Gazelle-63f08f0b62e30fa4e99318a11ede8879021efc80.tar.bz2
Empty commit
Diffstat (limited to 'static/functions/script_start.js')
-rw-r--r--static/functions/script_start.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/static/functions/script_start.js b/static/functions/script_start.js
index 4d96316..8f76d0c 100644
--- a/static/functions/script_start.js
+++ b/static/functions/script_start.js
@@ -210,6 +210,24 @@ function URL() {
return response;
}
+// jQuery plugin to prevent double submission of forms
+jQuery.fn.preventDoubleSubmission = function() {
+ $(this).bind('submit',function(e){
+ var $form = $(this);
+
+ if ($form.data('submitted') === true) {
+ // Previously submitted - don't submit again
+ e.preventDefault();
+ } else {
+ // Mark it so that the next submit can be ignored
+ $form.data('submitted', true);
+ }
+ });
+
+ // Keep chainability
+ return this;
+};
+
jQuery.extend(jQuery.prototype, {
results: function () {
return this.size();