Procházet zdrojové kódy

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

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2419 a333f486-631f-4898-b8df-5754b55c2be0
dflaven před 12 roky
rodič
revize
4914150615
1 změnil soubory, kde provedl 8 přidání a 0 odebrání
  1. 8 0
      pages/ajax.render.php

+ 8 - 0
pages/ajax.render.php

@@ -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;