Use data instead of disabled prop when clicking on button
The action may actually disable the button.
This commit is contained in:
1 parent
88bdd712cc
commit
a6e1420b2a
1 file changed
+8
-2
+8
-2
@@ -253,10 +253,16 @@
|
||||
this.buttons[item.id].click(item, function(event) {
|
||||
var item = event.data;
|
||||
var button = this.buttons[item.id];
|
||||
button.prop('disabled', true);
|
||||
// Use data instead of disabled prop because the action may
|
||||
// actually disable the button.
|
||||
if (button.data('disabled')) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
button.data('disabled', true);
|
||||
(this[item.id](this) || jQuery.when())
|
||||
.always(function() {
|
||||
button.prop('disabled', false);
|
||||
button.data('disabled', false);
|
||||
});
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user