From fab75c0882e82e1a9e158671d0c9a531d8e2c843 Mon Sep 17 00:00:00 2001 From: Paul Taylor Date: Thu, 22 Oct 2015 08:07:09 +0200 Subject: [PATCH] Update jquery_ujs.js patch for safari web browser - disable_with modification (button & link_to) lines 266, 481-488 --- vendor/assets/javascripts/jquery_ujs.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/vendor/assets/javascripts/jquery_ujs.js b/vendor/assets/javascripts/jquery_ujs.js index ffbc0ef0..a3e1da45 100644 --- a/vendor/assets/javascripts/jquery_ujs.js +++ b/vendor/assets/javascripts/jquery_ujs.js @@ -263,6 +263,7 @@ - Sets disabled property to false */ enableFormElements: function(form) { + form.data('disabling', false); rails.formElements(form, rails.enableSelector).each(function() { rails.enableFormElement($(this)); }); @@ -477,8 +478,14 @@ return false; } else { - // slight timeout so that the submit button gets properly serialized - setTimeout(function(){ rails.disableFormElements(form); }, 13); + if(! form.data('disabling')){ + e.preventDefault(); + form.data('disabling', true); + // slight timeout so that the submit button gets properly serialized + setTimeout(function(){ rails.disableFormElements(form); }, 13); + // further timeout so Safari repaints the changes + setTimeout(function(){ form.submit(); }, 15); + } } });