diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-06-15 00:15:46 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz1@gmail.com> | 2016-06-15 18:37:45 +0300 |
commit | 415b032ba1d003bb407581ce3069c95ac178bfd4 (patch) | |
tree | 83424f0d577323fe9729520bbd182beb2a003cd5 /app/assets/javascripts/lib | |
parent | 93a496d270cb638c76a4df45a74121c189146888 (diff) |
Prevent default disabled buttons and links.
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r-- | app/assets/javascripts/lib/common_utils.js.coffee | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/common_utils.js.coffee b/app/assets/javascripts/lib/common_utils.js.coffee index 5e3a802f45f..4f1779b8483 100644 --- a/app/assets/javascripts/lib/common_utils.js.coffee +++ b/app/assets/javascripts/lib/common_utils.js.coffee @@ -32,5 +32,12 @@ .attr 'title', newTitle .tooltip 'fixTitle' + gl.utils.preventDisabledButtons = -> + + $('.btn').click (e) -> + if $(this).hasClass 'disabled' + e.preventDefault() + e.stopImmediatePropagation() + return false ) window |