From fcd5ed7b5937f9dc30597f68878de6d426d9ac16 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 17 May 2021 14:56:35 -0600 Subject: [PATCH] Fix clicking sidebox entries closed the category --- api/js/framework/fw_ui.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/api/js/framework/fw_ui.js b/api/js/framework/fw_ui.js index 6a79ddb7d9..27f84b48be 100644 --- a/api/js/framework/fw_ui.js +++ b/api/js/framework/fw_ui.js @@ -876,10 +876,23 @@ function egw_fw_ui_category(_contDiv, _name, _title, _content, _callback, _anima //Add content and header to the content div, add some magic jQuery code in order to make it foldable this.headerDiv._parent = this; - jQuery(this.headerDiv).on("click keydown", + entryH2._parent = this; + jQuery(this.headerDiv).on("keydown", function(e) { if(e.type == "keydown" && [EGW_KEY_ENTER, EGW_KEY_SPACE].indexOf(e.which) == -1) return; - if (!jQuery(this).hasClass('egw_fw_ui_category_active')) + if (!jQuery(this).hasClass("egw_fw_ui_category_active")) + { + this._parent.open(false); + } + else + { + this._parent.close(false); + } + e.stopPropagation(); + }); + jQuery(entryH2).on("click", + function(e) { + if (!jQuery(this).parent().hasClass("egw_fw_ui_category_active")) { this._parent.open(false); }