summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2012-10-23 22:49:19 (GMT)
committer webchick2012-10-23 22:49:19 (GMT)
commitdc3f7af04df5dbb5669c407a2ddf5e057a1ff0fd (patch)
tree4afa02ce712b20a9547e5cc3f4d58e9223b3b083
parentffd207cbe8a1b3e5fac42a09806a90f47ce13d58 (diff)
Issue #1006042 by ksenzee, grendzy, scor: Fixed Links outside the overlay with existing fragments are broken.
-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