Skip to content

Commit

Permalink
Dialog: added ability to set the resize handles.
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgonzalez committed Jun 4, 2008
1 parent b80fb72 commit 9caa12a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ui/source/ui.dialog.js
Expand Up @@ -33,6 +33,9 @@ $.widget("ui.dialog", {
init: function() {
var self = this,
options = this.options,
resizeHandles = typeof options.resizable == 'string'
? options.resizable
: 'n,e,s,w,se,sw,ne,nw',

uiDialogContent = this.element
.addClass('ui-dialog-content')
Expand Down Expand Up @@ -125,16 +128,14 @@ $.widget("ui.dialog", {
}

if ($.fn.resizable) {
$.each('n,s,e,w,ne,se,sw,nw'.split(','), function() {
uiDialog.append('<div class="ui-resizable-' + this + ' ui-resizable-handle"></div>');
});
uiDialog.resizable({
maxWidth: options.maxWidth,
maxHeight: options.maxHeight,
minWidth: options.minWidth,
minHeight: options.minHeight,
start: options.resizeStart,
resize: options.resize,
handles: resizeHandles,
stop: function(e, ui) {
(options.resizeStop && options.resizeStop.apply(this, arguments));
$.ui.dialog.overlay.resize();
Expand All @@ -160,6 +161,7 @@ $.widget("ui.dialog", {
this.position(value);
break;
case "resizable":
(typeof value == 'string' && this.uiDialog.data('handles.resizable', value));
this.uiDialog.resizable(value ? 'enable' : 'disable');
break;
case "title":
Expand Down

0 comments on commit 9caa12a

Please sign in to comment.