Hi,

PFA patch to fix the issue where "Dialog Help" was broken in case where
query tool/Debugger opens in new browser tab.
RM#2310

*Note:*
Object help might not work as well when used in new browser tab but for
that we might need to find a way to pass node & server information in new
browser tab so that we can able to create proper url for given/selected
object which requires some time and fortunately we not using Object help
button in query tool or debugger at present, meanwhile this patch will fix
the issue for dialog help button only.
diff --git a/web/pgadmin/browser/templates/browser/js/browser.js 
b/web/pgadmin/browser/templates/browser/js/browser.js
index 7df56d0..b195e84 100644
--- a/web/pgadmin/browser/templates/browser/js/browser.js
+++ b/web/pgadmin/browser/templates/browser/js/browser.js
@@ -706,19 +706,26 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, 
CodeMirror) {
         iframe.openURL(fullUrl);
       } else if(type == "dialog_help") {
         // See if we can find an existing panel, if not, create one
-        pnlDialogHelp = this.docker.findPanels('pnl_online_help')[0];
-
-        if (pnlDialogHelp == null) {
-          pnlProperties = this.docker.findPanels('properties')[0];
-          this.docker.addPanel('pnl_online_help', wcDocker.DOCK.STACKED, 
pnlProperties);
+        if(this.docker) {
           pnlDialogHelp = this.docker.findPanels('pnl_online_help')[0];
-        }
 
-        // Update the panel
-        iframe = $(pnlDialogHelp).data('embeddedFrame');
+          if (pnlDialogHelp == null) {
+            pnlProperties = this.docker.findPanels('properties')[0];
+            this.docker.addPanel('pnl_online_help', wcDocker.DOCK.STACKED, 
pnlProperties);
+            pnlDialogHelp = this.docker.findPanels('pnl_online_help')[0];
+          }
+
+          // Update the panel
+          iframe = $(pnlDialogHelp).data('embeddedFrame');
 
-        pnlDialogHelp.focus();
-        iframe.openURL(url);
+          pnlDialogHelp.focus();
+          iframe.openURL(url);
+        } else {
+          // We have added new functionality of opening Query tool & debugger 
in new
+          // browser tab, In that case we wil not have docker object available
+          // so we will open dialog help in new browser tab
+          window.open(url, '_blank');
+        }
       }
     },
 
-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

Reply via email to