From d2a11fcba18876e2b3c05f7e54dbbd990a379491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 7 Sep 2019 23:32:47 +0200 Subject: [PATCH] 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 --- src/window.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/window.js b/src/window.js index b2cf5e96d8..8aacb56bb6 100644 --- a/src/window.js +++ b/src/window.js @@ -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); },