Do not execute tab shortcuts if there is a modal open

The modals are linked to the current tab so we can not change the tab as long
as there is a modal.

Closes #14042
This commit is contained in:
Cédric Krier
2025-05-28 18:02:21 +02:00
parent e88fea9fc6
commit eadd7bcffe
+10 -4
View File
@@ -1084,20 +1084,26 @@ var Sao = {
shortcut: 'alt+shift+tab',
label: Sao.i18n.gettext('Previous tab'),
callback: function() {
Sao.Tab.previous_tab();
if (!jQuery('body').children('.modal').length) {
Sao.Tab.previous_tab();
}
},
}, {
shortcut: 'alt+tab',
label: Sao.i18n.gettext('Next tab'),
callback: function() {
Sao.Tab.next_tab();
if (!jQuery('body').children('.modal').length) {
Sao.Tab.next_tab();
}
},
}, {
shortcut: 'ctrl+k',
label: Sao.i18n.gettext('Global search'),
callback: function() {
jQuery('#main_navbar:hidden').collapse('show');
jQuery('#global-search-entry').focus();
if (!jQuery('body').children('.modal').length) {
jQuery('#main_navbar:hidden').collapse('show');
jQuery('#global-search-entry').focus();
}
},
}, {
shortcut: 'f1',