From 257a1a63739f43e59ec43580f969918fa80e290a Mon Sep 17 00:00:00 2001 From: WoH Date: Mon, 3 Dec 2018 18:07:05 +0100 Subject: Do not disable previously disabled elements --- actionview/app/assets/javascripts/rails-ujs/features/disable.coffee | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionview/app') diff --git a/actionview/app/assets/javascripts/rails-ujs/features/disable.coffee b/actionview/app/assets/javascripts/rails-ujs/features/disable.coffee index a8c692ee62..4cfaead078 100644 --- a/actionview/app/assets/javascripts/rails-ujs/features/disable.coffee +++ b/actionview/app/assets/javascripts/rails-ujs/features/disable.coffee @@ -34,6 +34,7 @@ Rails.disableElement = (e) -> # Replace element's html with the 'data-disable-with' after storing original html # and prevent clicking on it disableLinkElement = (element) -> + return if getData(element, 'ujs:disabled') replacement = element.getAttribute('data-disable-with') if replacement? setData(element, 'ujs:enable-with', element.innerHTML) # store enabled state @@ -58,6 +59,7 @@ disableFormElements = (form) -> formElements(form, Rails.formDisableSelector).forEach(disableFormElement) disableFormElement = (element) -> + return if getData(element, 'ujs:disabled') replacement = element.getAttribute('data-disable-with') if replacement? if matches(element, 'button') -- cgit v1.2.3