Fixed blank screen issue while opening online help in new window. #5503

This commit is contained in:
Nikhil Mohite 2022-12-09 11:50:53 +05:30 committed by GitHub
parent cc0d467927
commit adfef8e2bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -248,11 +248,6 @@ function launchPgAdminWindow() {
docsURLSubStrings.forEach(function (key) {
if (url.indexOf(key) >= 0) {
isDocURL = true;
if(key.indexOf('help') >= 0) {
url = url.slice(url.indexOf('/help'))
url = startPageUrl.slice(0, startPageUrl.indexOf('?') -1 ) + url;
}
}
});

View File

@ -10,6 +10,9 @@ import gettext from 'sources/gettext';
import pgAdmin from 'sources/pgadmin';
import { getBrowser } from '../../../static/js/utils';
import Menu, { MenuItem } from './new_menu';
import getApiInstance from '../../../static/js/api_instance';
import url_for from 'sources/url_for';
import Notifier from '../../../static/js/helpers/Notifier';
export let MainMenus = [
{ label: gettext('File'), name: 'file', id: 'mnu_file', index: 0, addSepratior: true },
@ -64,7 +67,14 @@ export class MainMenuItemFactory {
options.callback(options);
} else {
if (options.url != '#') {
let api = getApiInstance();
api(
url_for('tools.initialize')
).then(()=>{
window.open(options.url);
}).catch(()=>{
Notifier.error(gettext('Error in opening window'));
});
}
}
}}, (menu, item)=> {