diff --git a/core/misc/dialog.position.js b/core/misc/dialog.position.js index b718e80..ec4fb31 100644 --- a/core/misc/dialog.position.js +++ b/core/misc/dialog.position.js @@ -50,12 +50,11 @@ var left = offsets.left - offsets.right; var top = offsets.top - offsets.bottom; - var leftString = (left > 0 ? '+' : '-') + Math.round(left/2) + 'px'; - var topString = (top > 0 ? '+' : '-') + Math.round(top/2) + 'px'; + var leftString = (left > 0 ? '+' : '-') + Math.abs(Math.round(left/2)) + 'px'; + var topString = (top > 0 ? '+' : '-') + Math.abs(Math.round(top/2)) + 'px'; options.position = { my: 'center' + (left !== 0 ? leftString : '') + ' center' + (top !== 0 ? topString : '') }; - console.log(options); return options; } @@ -78,4 +77,5 @@ } }); -})(jQuery, Drupal, drupalSettings, Drupal.debounce, Drupal.displace); +// @todo remove window.parent once overlay is removed from core. +})(jQuery, Drupal, drupalSettings, Drupal.debounce, window.parent.Drupal.displace);