diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-10-23 15:49:19 -0700 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-10-23 15:49:19 -0700 |
commit | dc3f7af04df5dbb5669c407a2ddf5e057a1ff0fd (patch) | |
tree | 4afa02ce712b20a9547e5cc3f4d58e9223b3b083 /modules/overlay | |
parent | ffd207cbe8a1b3e5fac42a09806a90f47ce13d58 (diff) | |
download | brdo-dc3f7af04df5dbb5669c407a2ddf5e057a1ff0fd.tar.gz brdo-dc3f7af04df5dbb5669c407a2ddf5e057a1ff0fd.tar.bz2 |
Issue #1006042 by ksenzee, grendzy, scor: Fixed Links outside the overlay with existing fragments are broken.
Diffstat (limited to 'modules/overlay')
-rw-r--r-- | modules/overlay/overlay-parent.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js index 521bd7689..413475977 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 |