Bug fix: "save" in edit dashboard did nothing on Chrome on a *just reloaded* dashboard (actually on any page which URL contained a hash)

SVN:trunk[2419]
This commit is contained in:
Denis Flaven
2012-11-12 10:36:34 +00:00
parent 59b7c0c025
commit b22c23dfee

View File

@@ -801,6 +801,14 @@ try
$oDashboard->FromParams($aParams);
$oDashboard->Save();
// trigger a reload of the current page since the dashboard just changed
$oPage->add_ready_script(
<<<EOF
var sLocation = new String(window.location.href);
var sNewLocation = sLocation.replace('&edit=1', '');
sNewLocation = sLocation.replace(/#(.?)$/, ''); // Strips everything after the hash, since IF the URL does not change AND contains a hash, then Chrome does not reload the page
window.location.href = sNewLocation;
EOF
);
$oPage->add_ready_script("sLocation = new String(window.location.href); window.location.href=sLocation.replace('&edit=1', '');"); // reloads the page, doing a GET even if we arrived via a POST
break;