changeset 98556d1accc8 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=98556d1accc8
description:
        Allow unselecting a predefined export

        We just toggle the class instead of always add it on click and set the 
export
        only if the resulted element has the class.

        issue8628
        review280031005
diffstat:

 src/window.js |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r 45040c3b6577 -r 98556d1accc8 src/window.js
--- a/src/window.js     Sat Sep 07 23:30:28 2019 +0200
+++ b/src/window.js     Sat Sep 07 23:32:47 2019 +0200
@@ -1648,9 +1648,11 @@
                     node.click();
                 }
             }).click(function(event) {
-                node.addClass('bg-primary')
+                node.toggleClass('bg-primary')
                     .siblings().removeClass('bg-primary');
-                this.sel_predef(jQuery(event.target).attr('export_id'));
+                if (node.hasClass('bg-primary')) {
+                    this.sel_predef(node.attr('export_id'));
+                }
             }.bind(this));
             this.predef_exports_list.append(node);
         },

Reply via email to