changeset 8f3ba65ccaff in sao:5.0
details: https://hg.tryton.org/sao?cmd=changeset&node=8f3ba65ccaff
description:
        Do not remove disabled property after button execution

        We must let the display of the screen reset the state of the button.

        issue10922
        review391061002
        (grafted from 0b692f8ac30864b7ec75bf542909fc4b5ea81dcf)
diffstat:

 src/view/form.js |  6 ++----
 src/view/tree.js |  6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diffs (32 lines):

diff -r 8dba76c6e8ef -r 8f3ba65ccaff src/view/form.js
--- a/src/view/form.js  Sun Oct 31 10:20:24 2021 +0100
+++ b/src/view/form.js  Sun Oct 31 10:24:32 2021 +0100
@@ -387,10 +387,8 @@
         },
         button_clicked: function(event) {
             var button = event.data;
-            button.el.prop('disabled', true);
-            this.screen.button(button.attributes).always(function() {
-                button.el.prop('disabled', false);
-            });
+            button.el.prop('disabled', true);  // state will be reset at 
display
+            this.screen.button(button.attributes);
         },
         selected_records: function() {
             if (this.screen.current_record) {
diff -r 8dba76c6e8ef -r 8f3ba65ccaff src/view/tree.js
--- a/src/view/tree.js  Sun Oct 31 10:20:24 2021 +0100
+++ b/src/view/tree.js  Sun Oct 31 10:24:32 2021 +0100
@@ -1985,10 +1985,8 @@
             if (states.invisible || states.readonly) {
                 return;
             }
-            button.el.prop('disabled', true);
-            this.screen.button(this.attributes).always(function() {
-                button.el.prop('disabled', false);
-            });
+            button.el.prop('disabled', true);  // state will be reset at 
display
+            this.screen.button(this.attributes);
         }
     });
 

Reply via email to