diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js index f0bb97877..d15970592 100644 --- a/web/pgadmin/browser/static/js/browser.js +++ b/web/pgadmin/browser/static/js/browser.js @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////// import { generateNodeUrl } from './node_ajax'; -import Notify from '../../../static/js/helpers/Notifier'; +import Notify, {initializeModalProvider, initializeNotifier} from '../../../static/js/helpers/Notifier'; define('pgadmin.browser', [ 'sources/gettext', 'sources/url_for', 'require', 'jquery', 'underscore', @@ -439,6 +439,9 @@ define('pgadmin.browser', [ } initializeBrowserTree(obj); + initializeModalProvider(); + initializeNotifier(); + // Syntax highlight the SQL Pane if(document.getElementById('sql-textarea')){ diff --git a/web/pgadmin/static/js/helpers/Notifier.jsx b/web/pgadmin/static/js/helpers/Notifier.jsx index 0bb8b1554..ef05eff0f 100644 --- a/web/pgadmin/static/js/helpers/Notifier.jsx +++ b/web/pgadmin/static/js/helpers/Notifier.jsx @@ -132,7 +132,7 @@ var Notifier = { notify(content, autoHideDuration) { if (content) { if(!notifierInitialized) { - initializeNotifier(document.getElementById('notifierContainer')); + initializeNotifier(); } let options = {autoHideDuration, content:(key) => ( {React.cloneElement(content, {onClose:()=>{snackbarRef.closeSnackbar(key);}})} @@ -221,7 +221,7 @@ var Notifier = { }, alert: (title, text, okLabel=gettext('OK'), onOkClick)=>{ if(!modalInitialized) { - initializeModalProvider(document.getElementById('modalContainer')); + initializeModalProvider(); } modalRef.showModal(title, (closeModal)=>{ const onOkClickClose = ()=>{ @@ -235,7 +235,7 @@ var Notifier = { }, confirm: (title, text, onOkClick, onCancelClick, okLabel=gettext('Yes'), cancelLabel=gettext('No'))=>{ if(!modalInitialized) { - initializeModalProvider(document.getElementById('modalContainer')); + initializeModalProvider(); } modalRef.showModal(title, (closeModal)=>{ const onCancelClickClose = ()=>{ @@ -255,7 +255,7 @@ var Notifier = { if(window.frameElement) { Notifier = pgWindow.Notifier || Notifier; -} else { +} else if(!pgWindow.Notifier){ pgWindow.Notifier = Notifier; } export default Notifier; diff --git a/web/pgadmin/templates/base.html b/web/pgadmin/templates/base.html index 665cab9e4..fad6ec5f1 100644 --- a/web/pgadmin/templates/base.html +++ b/web/pgadmin/templates/base.html @@ -74,8 +74,6 @@ {% block body %}{% endblock %} -
-