Index: modules/overlay/overlay-parent.js =================================================================== RCS file: /cvs/drupal/drupal/modules/overlay/overlay-parent.js,v retrieving revision 1.22 diff -u -r1.22 overlay-parent.js --- modules/overlay/overlay-parent.js 14 Jan 2010 04:06:54 -0000 1.22 +++ modules/overlay/overlay-parent.js 25 Jan 2010 15:21:13 -0000 @@ -674,16 +674,19 @@ 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; } } + // The overlay-exclude class allows to prevent opening a link in the overlay. + 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.