Use jquery to get the window width

This commit is contained in:
Robin Appelman 2014-05-13 12:58:02 +02:00
parent 46d6cb739d
commit c85e6d919e
1 changed files with 2 additions and 2 deletions

View File

@ -67,8 +67,8 @@
self.parent = self.$dialog.parent().length > 0 ? self.$dialog.parent() : $('body');
var pos = self.parent.position();
self.$dialog.css({
left: pos.left + (window.innerWidth - self.$dialog.outerWidth())/2,
top: pos.top + (window.innerHeight - self.$dialog.outerHeight())/2
left: pos.left + ($(window).innerWidth() - self.$dialog.outerWidth())/2,
top: pos.top + ($(window).innerHeight() - self.$dialog.outerHeight())/2
});
});