summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/overlay/overlay-parent.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js
index ddac5633f..ab013f6d6 100644
--- a/modules/overlay/overlay-parent.js
+++ b/modules/overlay/overlay-parent.js
@@ -680,16 +680,19 @@ Drupal.overlay.clickHandler = function (event) {
return;
}
- // Only continue if clicked target (or one of its parents) is a link and does
- // not have class overlay-exclude. The overlay-exclude class allows to prevent
- // opening a link in the overlay.
- if (!$target.is('a') || $target.hasClass('overlay-exclude')) {
+ // Only continue if clicked target (or one of its parents) is a link.
+ if (!$target.is('a')) {
$target = $target.closest('a');
if (!$target.length) {
return;
}
}
+ // Never open links in the overlay that contain the overlay-exclude class.
+ if ($target.hasClass('overlay-exclude')) {
+ return;
+ }
+
var href = $target.attr('href');
// Only continue if link has an href attribute and is not just linking to
// an anchor.