From 2f9fd67579a7d9db2853839dd6588d992a03fa69 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Wed, 10 Feb 2010 05:50:49 +0000 Subject: #668104 follow-up by casey and pwolanin: Fixes + revised comments for overlay-exclude class. --- modules/overlay/overlay-parent.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'modules') 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. -- cgit v1.2.3