diff --git a/resources/js/designer/move.ts b/resources/js/designer/move.ts index e2c748b2e3..6fe18ce5a1 100644 --- a/resources/js/designer/move.ts +++ b/resources/js/designer/move.ts @@ -1019,7 +1019,8 @@ const saveAs = function () { } var modal = DesignerMove.displayModal(data.message, window.Messages.strSavePageAs, '#designerGoModal'); - $('#designerModalGoButton').on('click', function () { + $('#save_as_pages').on('submit', function (e) { + e.preventDefault(); var $form = $('#save_as_pages'); var selectedValue = ($form.find('input[name="selected_value"]').val() as string).trim(); var $selectedPage = $form.find('select[name="selected_page"]'); @@ -1088,6 +1089,10 @@ const saveAs = function () { modal.modal('hide'); }); + $('#designerModalGoButton').on('click', function () { + $('#save_as_pages').trigger('submit'); + }); + // select current page by default if (DesignerConfig.selectedPage !== -1) { $('select[name="selected_page"]').val(DesignerConfig.selectedPage); diff --git a/resources/js/modules/navigation.ts b/resources/js/modules/navigation.ts index 92e86b6b9a..a07a2df3aa 100644 --- a/resources/js/modules/navigation.ts +++ b/resources/js/modules/navigation.ts @@ -165,7 +165,11 @@ function loadChildNodes (isNode, $expandElem, callback): void { } $.post('index.php?route=/navigation&ajax_request=1', params, function (data) { - if (typeof data !== 'undefined' && data.success === true) { + if (typeof data === 'undefined') { + return; + } + + if (data.success === true) { $destination.find('div.list_container').remove(); // FIXME: Hack, there shouldn't be a list container there if (isNode) { $destination.append(data.message); @@ -192,7 +196,7 @@ function loadChildNodes (isNode, $expandElem, callback): void { if (callback && typeof callback === 'function') { callback(data); } - } else if (typeof data !== 'undefined' && data.redirect_flag === '1') { + } else if (data.redirect_flag === '1') { if (window.location.href.indexOf('?') === -1) { window.location.href += '?session_expired=1'; } else { @@ -643,7 +647,11 @@ function reload (callback = null, paths = null): void { function requestNaviReload (params) { $.post('index.php?route=/navigation&ajax_request=1', params, function (data) { - if (typeof data !== 'undefined' && data.success) { + if (typeof data === 'undefined') { + return; + } + + if (data.success) { $('#pma_navigation_tree').html(data.message).children('div').show(); if ($('#pma_navigation_tree').hasClass('synced')) { Navigation.selectCurrentDatabase();