1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Support for data-disable='true' when using class 'e-ajax'. ie. prevent double-clicking.

This commit is contained in:
Cameron 2020-02-02 14:06:56 -08:00
parent b824bc028e
commit 955af62106

View File

@ -597,6 +597,11 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
var form = $element.closest("form");
var data = form.serialize() || '';
if($element.attr('data-disable') == 'true')
{
$element.addClass('disabled');
}
$.ajax({
type: options.type || 'POST',
url: options.url,
@ -612,6 +617,11 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
{
$loadingImage.remove();
}
if($element.attr('data-disable') == 'true')
{
$element.removeClass('disabled');
}
},
success: function (response)
{