Do not run menu action if the menuitem is disabled

The click event can still be triggered by the shortcut or event by clicking on
the disabled menuitem. So the callback must not run the action if the menuitem
is disabled.

Closes #13326
This commit is contained in:
Cédric Krier
2024-06-10 18:01:03 +02:00
parent 72e5a47ea2
commit 0807b42e87
+3 -1
View File
@@ -158,7 +158,9 @@
this.menu_buttons[item.id] = menuitem;
link.click(evt => {
evt.preventDefault();
this[item.id]();
if (!menuitem.hasClass('disabled')) {
this[item.id]();
}
});
} else if (!item && previous) {
menuitem = jQuery('<li/>', {