Elastic: Handle more corner cases of hide-menu event

pull/6256/head
Aleksander Machniak 6 years ago
parent 38bda972c1
commit f89fafb781

@ -2136,9 +2136,14 @@ function rcube_elastic_ui()
else {
target = $('#' + name).data('button');
// catch cases as 'forwardmenu' where menu suffix has no hyphen
if (!target && name.match(/(?!-)menu$/)) {
target = $('#' + name.substr(0, name.length - 4) + '-menu').data('button');
if (!target) {
// catch cases as 'forwardmenu' where menu suffix has no hyphen
// or try with -menu suffix if it's not in the menu name already
if (name.match(/(?!-)menu$/)) {
name = name.substr(0, name.length - 4);
}
target = $('#' + name + '-menu').data('button');
}
}

Loading…
Cancel
Save