Prevent the default styles for resizable elements from totally killing dialog positioning (finally).

Fixes #5084 - 2 dialogs pos false on close.
This commit is contained in:
Scott González 2010-01-28 03:06:43 +00:00
parent dd92e16081
commit 65b063b039

View File

@ -352,6 +352,9 @@ $.widget("ui.dialog", {
handles = (handles === undefined ? this.options.resizable : handles); handles = (handles === undefined ? this.options.resizable : handles);
var self = this, var self = this,
options = self.options, options = self.options,
// .ui-resizable has position: relative defined in the stylesheet
// but dialogs have to use absolute or fixed positioning
position = self.uiDialog.css('position'),
resizeHandles = typeof handles == 'string' resizeHandles = typeof handles == 'string'
? handles ? handles
: 'n,e,s,w,se,sw,ne,nw'; : 'n,e,s,w,se,sw,ne,nw';
@ -380,6 +383,7 @@ $.widget("ui.dialog", {
$.ui.dialog.overlay.resize(); $.ui.dialog.overlay.resize();
} }
}) })
.css('position', position)
.find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se'); .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
}, },