diff options
author | Staicu Ionut <github@iamntz.com> | 2012-07-10 08:33:04 +0400 |
---|---|---|
committer | Staicu Ionut <github@iamntz.com> | 2012-07-10 08:33:04 +0400 |
commit | ba7b85d0d986e7c511aa91bde97b3a992bb5d436 (patch) | |
tree | 135989b8950030545f5157e2228cd93e2064872f /app/assets/javascripts/application.js | |
parent | be1b40802dcbfd59ecdd3c7439fc48d6cec97e2b (diff) |
issues counter are now live updated on creation/deleteion/reopening
buttons on forms are disabled on submit (re-enabled after the request is complete)
Diffstat (limited to 'app/assets/javascripts/application.js')
-rw-r--r-- | app/assets/javascripts/application.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 42290f8e154..683d8fa80b4 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -20,10 +20,26 @@ //= require_tree . $(document).ready(function(){ + $(".one_click_select").live("click", function(){ $(this).select(); }); + + $('body').on('ajax:complete, ajax:beforeSend, submit', 'form', function(e){ + var buttons = $('[type="submit"]', this); + switch( e.type ){ + case 'ajax:beforeSend': + case 'submit': + buttons.attr('disabled', 'disabled'); + break; + case ' ajax:complete': + default: + buttons.removeAttr('disabled'); + break; + } + }) + $(".account-box").mouseenter(showMenu); $(".account-box").mouseleave(resetMenu); |