Commit 1e9409ad authored by Dries's avatar Dries
Browse files

- Patch #690288 by casey, klausi: back button in overlay doesn't work properly...

- Patch #690288 by casey, klausi: back button in overlay doesn't work properly when there's redirection, e.g. #admin/structure/trigger.
parent 78d4c094
......@@ -862,8 +862,9 @@ Drupal.overlay.fragmentizeLink = function (link) {
// true to prevent transforming this link into a clean URL while clean URLs
// may be disabled.
var path = self.getPath(link, true);
// Preserve existing query and fragment parameters in the URL.
var destination = path + link.search + link.hash;
// Preserve existing query and fragment parameters in the URL, except for
// "render=overlay" which is re-added in Drupal.overlay.hashchangeHandler.
var destination = path + link.search.replace(/&?render=overlay/, '').replace(/\?$/, '') + link.hash;
// Assemble and return the overlay-ready link.
return $.param.fragment(window.location.href, { overlay: destination });
......@@ -892,7 +893,8 @@ Drupal.overlay.syncChildLocation = function (childLocation) {
// Set a 'redirect' flag on the new location so the hashchange event handler
// knows not to change the overlay's content.
$.data(window.location, newLocation, 'redirect');
window.location.href = newLocation;
// Using location.replace so we don't create an extra history entry.
window.location.replace(newLocation);
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment