Fixed persistent menu bar after clicking on an entry

canary
WolverinDEV 2019-12-03 16:59:04 +01:00
parent eff220de5d
commit b82267d67f
1 changed files with 8 additions and 1 deletions

View File

@ -85,9 +85,12 @@ namespace top_menu {
if(this._callback_click && !disabled) {
this._callback_click();
}
event.preventDefault();
if(disabled)
event.stopPropagation();
else
HTMLMenuBarDriver.instance().close();
});
this._submenu_tag = $.spawn("div").addClass("sub-menu");
@ -183,7 +186,7 @@ namespace top_menu {
item._label_tag.on('click', enable_event => {
enable_event.preventDefault();
this.html_tag.find(".active").removeClass("active");
this.close();
item.html_tag.addClass("active");
setTimeout(() => {
@ -198,6 +201,10 @@ namespace top_menu {
return item;
}
close() {
this.html_tag.find(".active").removeClass("active");
}
delete_item(item: MenuItem) {
return undefined;
}