changeset ad355af736b2 in sao:6.2
details: https://hg.tryton.org/sao?cmd=changeset&node=ad355af736b2
description:
        Use data instead of disabled prop when clicking on button

        The action may actually disable the button.
        (grafted from dfaac32524e24107a4ec54cc6aecb1976c33909a)
diffstat:

 src/tab.js |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r 51b44e2d7817 -r ad355af736b2 src/tab.js
--- a/src/tab.js        Sat Mar 19 15:06:48 2022 +0100
+++ b/src/tab.js        Sat Mar 26 12:59:43 2022 +0100
@@ -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));
             };

Reply via email to