@@ -1,3 +1,8 @@
|
||||
/**
|
||||
* @file
|
||||
* Attaches the behaviors for the Overlay parent pages.
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
|
||||
/**
|
||||
@@ -339,7 +344,7 @@ Drupal.overlay.setFocusBefore = function ($element, document) {
|
||||
* Check if the given link is in the administrative section of the site.
|
||||
*
|
||||
* @param url
|
||||
* The url to be tested.
|
||||
* The URL to be tested.
|
||||
*
|
||||
* @return boolean
|
||||
* TRUE if the URL represents an administrative link, FALSE otherwise.
|
||||
@@ -374,7 +379,7 @@ Drupal.overlay.isAdminLink = function (url) {
|
||||
* Determine whether a link is external to the site.
|
||||
*
|
||||
* @param url
|
||||
* The url to be tested.
|
||||
* The URL to be tested.
|
||||
*
|
||||
* @return boolean
|
||||
* TRUE if the URL is external to the site, FALSE otherwise.
|
||||
@@ -560,7 +565,7 @@ Drupal.overlay.eventhandlerOverrideLink = function (event) {
|
||||
|
||||
var target = $target[0];
|
||||
var href = target.href;
|
||||
// Only handle links that have an href attribute and use the http(s) protocol.
|
||||
// Only handle links that have an href attribute and use the HTTP(S) protocol.
|
||||
if (href != undefined && href != '' && target.protocol.match(/^https?\:/)) {
|
||||
var anchor = href.replace(target.ownerDocument.location.href, '');
|
||||
// Skip anchor links.
|
||||
@@ -607,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
|
||||
|
||||
Reference in New Issue
Block a user