diff options
Diffstat (limited to 'modules/overlay/overlay-parent.js')
-rw-r--r-- | modules/overlay/overlay-parent.js | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js index f4688af69ace..e33543580ca1 100644 --- a/modules/overlay/overlay-parent.js +++ b/modules/overlay/overlay-parent.js @@ -650,15 +650,9 @@ Drupal.overlay.outerResize = function () { return; } - // Consider any region that should be visible above the overlay (such as - // an admin toolbar). - var $displaceTop = $('.overlay-displace-top'); - var displaceTopHeight = 0; - $displaceTop.each(function () { - displaceTopHeight += $(this).height(); - }); + var displaceTop = Drupal.displace ? Drupal.displace.getDisplacement('top') : 0; - self.$wrapper.css('top', displaceTopHeight); + self.$wrapper.css('top', displaceTop); // When the overlay has no height yet, make it fit exactly in the window, // or the configured height when autoFit is disabled. @@ -666,7 +660,7 @@ Drupal.overlay.outerResize = function () { var titleBarHeight = self.$dialogTitlebar.outerHeight(true); if (self.options.autoFit || self.options.height == undefined ||!isNan(self.options.height)) { - self.lastHeight = parseInt($(window).height() - displaceTopHeight - titleBarHeight - 45); + self.lastHeight = parseInt($(window).height() - displaceTop - titleBarHeight - 45); } else { self.lastHeight = self.options.height; @@ -703,11 +697,11 @@ Drupal.overlay.clickHandler = function (event) { var $target = $(event.target); - if (self.isOpen && $target.closest('.overlay-displace-top, .overlay-displace-bottom').length) { + if (self.isOpen && $target.closest('.displace-top, .displace-bottom').length) { // Click events in displaced regions could potentionally change the size of // that region (e.g. the toggle button of the toolbar module). Trigger the // resize event to force a recalculation of overlay's size/position. - $(window).triggerHandler('resize.overlay-event'); + $(window).triggerHandler('resize'); } // Only continue by left-click or right-click. @@ -929,7 +923,7 @@ Drupal.overlay.resetActiveClass = function(activePath) { var self = this; var windowDomain = window.location.protocol + window.location.hostname; - $('.overlay-displace-top, .overlay-displace-bottom') + $('.displace-top, .displace-bottom') .find('a[href]') // Remove active class from all links in displaced regions. .removeClass('active') |