Dialog: Fixed #3076: Proper sizing of overlays in Opera 9.51.

This commit is contained in:
Scott González 2008-07-14 00:50:01 +00:00
parent 30952e6b3f
commit dad128d84f

View File

@ -113,7 +113,7 @@ $.widget("ui.dialog", {
uiDialogTitlebar.find("*").add(uiDialogTitlebar).each(function() { uiDialogTitlebar.find("*").add(uiDialogTitlebar).each(function() {
$.ui.disableSelection(this); $.ui.disableSelection(this);
}); });
if ($.fn.draggable) { if ($.fn.draggable) {
uiDialog.draggable({ uiDialog.draggable({
cancel: '.ui-dialog-content', cancel: '.ui-dialog-content',
@ -433,6 +433,7 @@ $.extend($.ui.dialog.overlay, {
}, },
height: function() { height: function() {
// handle IE 6
if ($.browser.msie && $.browser.version < 7) { if ($.browser.msie && $.browser.version < 7) {
var scrollHeight = Math.max( var scrollHeight = Math.max(
document.documentElement.scrollHeight, document.documentElement.scrollHeight,
@ -448,12 +449,20 @@ $.extend($.ui.dialog.overlay, {
} else { } else {
return scrollHeight + 'px'; return scrollHeight + 'px';
} }
// handle Opera
} else if ($.browser.opera) {
return Math.max(
window.innerHeight,
$(document).height()
) + 'px';
// handle "good" browsers
} else { } else {
return $(document).height() + 'px'; return $(document).height() + 'px';
} }
}, },
width: function() { width: function() {
// handle IE 6
if ($.browser.msie && $.browser.version < 7) { if ($.browser.msie && $.browser.version < 7) {
var scrollWidth = Math.max( var scrollWidth = Math.max(
document.documentElement.scrollWidth, document.documentElement.scrollWidth,
@ -469,6 +478,13 @@ $.extend($.ui.dialog.overlay, {
} else { } else {
return scrollWidth + 'px'; return scrollWidth + 'px';
} }
// handle Opera
} else if ($.browser.opera) {
return Math.max(
window.innerWidth,
$(document).width()
) + 'px';
// handle "good" browsers
} else { } else {
return $(document).width() + 'px'; return $(document).width() + 'px';
} }