Skip to content

Commit

Permalink
Ticket #655
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed Jun 1, 2017
1 parent 224e84d commit 923ff2c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions inc/js/jquery.dolPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,22 +558,22 @@

} else if (o.position == 'centered') {

$el.position({
of: window,
my: 'center center+' + ($el.outerHeight() > $(window).height() ? parseInt(($el.outerHeight() - $(window).height()) / 2) : '0'),
at: 'center center',
collision: 'none none'
});

// attach window resize event
$(window).on('resize.popupWindow', function() {

$el.position({
of: window,
my: 'center center+' + ($el.outerHeight() > $(window).height() ? parseInt(($el.outerHeight() - $(window).height()) / 2) : '0'),
var oPosition = function(oElement) {
oElement.position({
of: window,
my: 'center center+' + (oElement.outerHeight() > $(window).height() ? parseInt((oElement.outerHeight() - $(window).height()) / 2) : '0'),
at: 'center center',
collision: 'none none'
});
};

oPosition($el);

// attach window resize event
$(window).on('resize.popupWindow', function() {
oPosition($el);
}).on('scroll', function() {
oPosition($el);
});

} else if (typeof o.position == 'object') {
Expand Down

0 comments on commit 923ff2c

Please sign in to comment.