app/assets/javascripts/jqr-helpers.js in jqr-helpers-1.0.25 vs app/assets/javascripts/jqr-helpers.js in jqr-helpers-1.0.26
- old
+ new
@@ -8,10 +8,12 @@
break;
default: // small or not given
$(element).after("<img src='/images/jqr-helpers/throbber.gif' class='throbber'/>");
}
$(element).attr('disabled', 'disabled');
+ // refresh disabled state
+ $(element).attr('autocomplete', 'off');
}
function hideThrobber(element) {
$(element).nextAll('.throbber').remove();
$('#ujs-dialog-throbber').remove();
@@ -273,11 +275,11 @@
}
$('#' + empty).show();
$(target).remove();
}
else {
- target.fadeOut(500, function() {$(this).remove()});
+ target.fadeOut(500, function() {$(this).remove()});
}
break;
}
target.effect('highlight');
if (element.data('scroll-to')) {
@@ -351,10 +353,11 @@
});
}
});
$(this).tabs(options);
});
+
}
$(function() {
if ($().on) { // newer jQueries
$(document).on('jqr.load', ujsLoadPlugins);
@@ -378,16 +381,9 @@
$('.ujs-ajax').live('ajax:success', ujsAjaxSuccess);
$('.ujs-ajax').live('ajax:error', ujsAjaxError);
$('[data-ujs-confirm=true]').live('click', ujsConfirmClick);
}
$('body').trigger('jqr.load');
-
- // Derived from
- // https://makandracards.com/makandra/3877-re-enable-submit-buttons-disabled-by-the-disabled_with-option
- $(window).unload(function() {
- $.rails.enableFormElements($($.rails.formSubmitSelector));
- $('input[disabled],button[disabled],select[disabled]').prop('disabled', false);
- });
});
}(jQuery));