More attempts to work around inconsistent browser location redirection
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 12 Nov 2010 21:59:46 +0000 (14:59 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 15 Nov 2010 23:41:23 +0000 (16:41 -0700)
imp/js/dimpbase.js
imp/js/dimpcore.js

index 1467ef4..d85a5eb 100644 (file)
@@ -162,7 +162,7 @@ var DimpBase = {
             $('appprefs').hasClassName('on')) {
             $('dimpPage').hide();
             $('dimpLoading').show();
-            return DimpCore.redirect(DIMP.conf.URI_DIMP + '#' + escape(loc), true);
+            return DimpCore.redirect(loc, true);
         }
 
         if (loc.startsWith('compose:')) {
index da720a9..362b080 100644 (file)
@@ -321,13 +321,16 @@ var DimpCore = {
         this.redirect(url || (DIMP.conf.URI_AJAX + 'logOut'));
     },
 
-    redirect: function(url, force)
+    // url = (string) URL to redirect to
+    // hash = (boolean) If true, url is treated as hash information to alter
+    //        on the current page
+    redirect: function(url, hash)
     {
-        window.location.assign(this.addURLParam(url));
-
-        // Catch browsers that don't redirect on assign().
-        if (force && !Prototype.Browser.WebKit) {
-            (function() { window.location.reload(); }).delay(0.5);
+        if (hash) {
+            window.location.hash = escape(url);
+            window.location.reload();
+        } else {
+            window.location.assign(this.addURLParam(url));
         }
     },