mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-03 20:20:46 -06:00
Fixed an issue where notifier not working when opening query tool in a new
window and then open it in the new tab.
This commit is contained in:
parent
91a288c2bb
commit
f24348b2b0
@ -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')){
|
||||
|
@ -132,7 +132,7 @@ var Notifier = {
|
||||
notify(content, autoHideDuration) {
|
||||
if (content) {
|
||||
if(!notifierInitialized) {
|
||||
initializeNotifier(document.getElementById('notifierContainer'));
|
||||
initializeNotifier();
|
||||
}
|
||||
let options = {autoHideDuration, content:(key) => (
|
||||
<FinalNotifyContent>{React.cloneElement(content, {onClose:()=>{snackbarRef.closeSnackbar(key);}})}</FinalNotifyContent>
|
||||
@ -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;
|
||||
|
@ -74,8 +74,6 @@
|
||||
<![endif]-->
|
||||
|
||||
{% block body %}{% endblock %}
|
||||
<div id="notifierContainer"></div>
|
||||
<div id="modalContainer"></div>
|
||||
<script type="application/javascript">
|
||||
{% block init_script %}{% endblock %}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user