aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/app/assets/javascripts/features/disable.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/app/assets/javascripts/features/disable.coffee')
-rw-r--r--actionview/app/assets/javascripts/features/disable.coffee4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionview/app/assets/javascripts/features/disable.coffee b/actionview/app/assets/javascripts/features/disable.coffee
index e8cce7da40..90aa3bdf0e 100644
--- a/actionview/app/assets/javascripts/features/disable.coffee
+++ b/actionview/app/assets/javascripts/features/disable.coffee
@@ -2,6 +2,10 @@
{ matches, getData, setData, stopEverything, formElements } = Rails
+Rails.handleDisabledElement = (e) ->
+ element = this
+ stopEverything(e) if element.disabled
+
# Unified function to enable an element (link, button and form)
Rails.enableElement = (e) ->
element = if e instanceof Event then e.target else e