mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Support for data-disable='true' when using class 'e-ajax'. ie. prevent double-clicking.
This commit is contained in:
@@ -597,6 +597,11 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
var form = $element.closest("form");
|
var form = $element.closest("form");
|
||||||
var data = form.serialize() || '';
|
var data = form.serialize() || '';
|
||||||
|
|
||||||
|
if($element.attr('data-disable') == 'true')
|
||||||
|
{
|
||||||
|
$element.addClass('disabled');
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: options.type || 'POST',
|
type: options.type || 'POST',
|
||||||
url: options.url,
|
url: options.url,
|
||||||
@@ -612,6 +617,11 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
{
|
{
|
||||||
$loadingImage.remove();
|
$loadingImage.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($element.attr('data-disable') == 'true')
|
||||||
|
{
|
||||||
|
$element.removeClass('disabled');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
success: function (response)
|
success: function (response)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user