mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Dialog: Fixed #3220: Non-resizable dialogs shouldn't instantiate resizables.
This commit is contained in:
parent
7e9dcd21de
commit
8bd855a162
@ -34,9 +34,6 @@ $.widget("ui.dialog", {
|
||||
|
||||
var self = this,
|
||||
options = this.options,
|
||||
resizeHandles = typeof options.resizable == 'string'
|
||||
? options.resizable
|
||||
: 'n,e,s,w,se,sw,ne,nw',
|
||||
|
||||
uiDialogContent = this.element
|
||||
.removeAttr('title')
|
||||
@ -134,8 +131,24 @@ $.widget("ui.dialog", {
|
||||
(options.draggable || uiDialog.draggable('disable'));
|
||||
}
|
||||
|
||||
if ($.fn.resizable) {
|
||||
uiDialog.resizable({
|
||||
(options.resizable && $.fn.resizable && this._makeResizable());
|
||||
|
||||
this._createButtons(options.buttons);
|
||||
this._isOpen = false;
|
||||
|
||||
(options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
|
||||
(options.autoOpen && this.open());
|
||||
},
|
||||
|
||||
_makeResizable: function(handles) {
|
||||
handles = (handles === undefined ? this.options.resizable : handles);
|
||||
var self = this,
|
||||
options = this.options,
|
||||
resizeHandles = typeof handles == 'string'
|
||||
? handles
|
||||
: 'n,e,s,w,se,sw,ne,nw';
|
||||
|
||||
this.uiDialog.resizable({
|
||||
cancel: '.ui-dialog-content',
|
||||
helper: options.resizeHelper,
|
||||
maxWidth: options.maxWidth,
|
||||
@ -156,14 +169,6 @@ $.widget("ui.dialog", {
|
||||
$.ui.dialog.overlay.resize();
|
||||
}
|
||||
});
|
||||
(options.resizable || uiDialog.resizable('disable'));
|
||||
}
|
||||
|
||||
this._createButtons(options.buttons);
|
||||
this._isOpen = false;
|
||||
|
||||
(options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
|
||||
(options.autoOpen && this.open());
|
||||
},
|
||||
|
||||
_setData: function(key, value){
|
||||
@ -182,8 +187,19 @@ $.widget("ui.dialog", {
|
||||
this._position(value);
|
||||
break;
|
||||
case "resizable":
|
||||
(typeof value == 'string' && this.uiDialog.data('handles.resizable', value));
|
||||
this.uiDialog.resizable(value ? 'enable' : 'disable');
|
||||
var uiDialog = this.uiDialog,
|
||||
isResizable = this.uiDialog.is(':data(resizable)');
|
||||
|
||||
// currently resizable, becoming non-resizable
|
||||
(isResizable && !value && uiDialog.resizable('destroy'));
|
||||
|
||||
// currently resizable, changing handles
|
||||
(isResizable && typeof value == 'string' &&
|
||||
uiDialog.resizable('option', 'handles', value));
|
||||
|
||||
// currently non-resizable, becoming resizable
|
||||
(isResizable || this._makeResizable(value));
|
||||
|
||||
break;
|
||||
case "title":
|
||||
$(".ui-dialog-title", this.uiDialogTitlebar).html(value || ' ');
|
||||
|
Loading…
Reference in New Issue
Block a user