[Yulup-commits] rev 20835 - public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content

andi at wyona.com andi at wyona.com
Wed Dec 13 23:05:22 CET 2006


Author: andi
Date: 2006-12-13 23:05:21 +0100 (Wed, 13 Dec 2006)
New Revision: 20835

Modified:
   public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/yulup.js
Log:
We have to remove old tabs and create new ones (although this messes up the tab order), otherwise we have a malfunctioning editor the next time we start one in the same tab.


Modified: public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/yulup.js
===================================================================
--- public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/yulup.js	2006-12-13 21:58:38 UTC (rev 20834)
+++ public/yulup/src/trunk/yulup/prototypes/prototype1/src/chrome/content/yulup.js	2006-12-13 22:05:21 UTC (rev 20835)
@@ -100,11 +100,12 @@
             openInNewTab = true;
         }
 
-        if (openInNewTab) {
-            // create a new tab
-            yulupTab = self.getBrowser().addTab("");
-        } else {
-            yulupTab = currentTab;
+        // create a new tab
+        yulupTab = self.getBrowser().addTab("");
+
+        if (!openInNewTab) {
+            // remove current tab
+            self.getBrowser().removeTab(currentTab);
         }
 
         // prepare parameters for pick-up
@@ -114,7 +115,7 @@
         targetURI = YULUP_EDITOR_CHROME_URI + "?" + instanceID;
 
         // load editor
-        self.getBrowser().getBrowserForTab(yulupTab).loadURI(targetURI, null, null);
+        self.getBrowser().getBrowserForTab(yulupTab).loadURIWithFlags(targetURI, Components.interfaces.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, null);
 
         // switch ui to newly created tab
         self.getBrowser().selectedTab = yulupTab;
@@ -944,7 +945,7 @@
 
         // if aURI is given, replace the tab, else close it
         if (aURI) {
-            self.getBrowser().getBrowserForTab(aOldTab).loadURIWithFlags(aURI, Components.interfaces.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY | Components.interfaces.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);
+            self.getBrowser().getBrowserForTab(aOldTab).loadURIWithFlags(aURI, Components.interfaces.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY, null, null);
         } else {
             self.getBrowser().removeTab(aOldTab);
         }




More information about the Phoenix-commits mailing list