summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/overlay/overlay-parent.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js
index 521bd76..4134759 100644
--- a/modules/overlay/overlay-parent.js
+++ b/modules/overlay/overlay-parent.js
@@ -612,7 +612,14 @@ Drupal.overlay.eventhandlerOverrideLink = function (event) {
else {
// Add the overlay-context state to the link, so "overlay-restore" links
// can restore the context.
- $target.attr('href', $.param.fragment(href, { 'overlay-context': this.getPath(window.location) + window.location.search }));
+ if ($target[0].hash) {
+ // Leave links with an existing fragment alone. Adding an extra
+ // parameter to a link like "node/1#section-1" breaks the link.
+ }
+ else {
+ // For links with no existing fragment, add the overlay context.
+ $target.attr('href', $.param.fragment(href, { 'overlay-context': this.getPath(window.location) + window.location.search }));
+ }
// When the link has a destination query parameter and that destination
// is an admin link we need to fragmentize it. This will make it reopen