summaryrefslogtreecommitdiffstatshomepage
path: root/modules/overlay
diff options
context:
space:
mode:
Diffstat (limited to 'modules/overlay')
-rw-r--r--modules/overlay/overlay-parent.js18
-rw-r--r--modules/overlay/overlay.module10
2 files changed, 6 insertions, 22 deletions
diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js
index f4688af69ac..e33543580ca 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')
diff --git a/modules/overlay/overlay.module b/modules/overlay/overlay.module
index c5b123b7bdf..5ac362ed983 100644
--- a/modules/overlay/overlay.module
+++ b/modules/overlay/overlay.module
@@ -300,16 +300,6 @@ function overlay_preprocess_page(&$variables) {
}
/**
- * Preprocess template variables for toolbar.tpl.php.
- *
- * Adding the 'overlay-displace-top' class to the toolbar pushes the overlay
- * down, so it appears below the toolbar.
- */
-function overlay_preprocess_toolbar(&$variables) {
- $variables['classes_array'][] = "overlay-displace-top";
-}
-
-/**
* Form after_build callback.
*
* After all hook_form_alter() implementations have been processed, we look at