File tree Expand file tree Collapse file tree
emhttp/plugins/dynamix.gui.search Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ function guiSearchBoxSpan() {
3737function setupGUIsearch() {
3838 window.addEventListener('keydown',function(e){
3939 if (!e.shiftKey && !e.altKey && (navigator.appVersion.indexOf('Mac')==-1 ? e.ctrlKey : e.metaKey) && e.keyCode==75) {
40+ // If a modal is visible, don't open the search box
41+ if ($('[role="modal"]').is(':visible')) return;
42+
4043 e.preventDefault();
4144 <?if ($themeHelper->isTopNavTheme()):?>
4245 if (guiSearchBoxSpan()) closeSearchBox(e); else gui_search();
@@ -79,6 +82,9 @@ function closeSearchBox(e) {
7982}
8083
8184function guiSearch() {
85+ // If a modal is visible, don't navigate away from the page
86+ if ($('[role="modal"]').is(':visible')) return;
87+
8288 var searchInfo = $('#guiSearchBox').val().split('**');
8389 var separator = ('fragmentDirective' in document) ? '#:~:text=' : '#';
8490 var scrollText = (typeof searchInfo[1] != 'undefined') ? separator+searchInfo[1].replace(' ','%20').replace('-','%2d') : '';
You can’t perform that action at this time.
0 commit comments