]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Don't call draggable.destroy if we're not currently draggable. Fixes #6069...
authorScott González <scott.gonzalez@gmail.com>
Mon, 20 Sep 2010 13:15:28 +0000 (09:15 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 20 Sep 2010 13:16:29 +0000 (09:16 -0400)
ui/jquery.ui.dialog.js

index c7ef437fc75b4b6af376d12e57d584cc69f807bd..029f91905cfcbd8ae5b0a43c2f1eb3b668a6d8a9 100644 (file)
@@ -521,7 +521,8 @@ $.widget("ui.dialog", {
        _setOption: function(key, value){
                var self = this,
                        uiDialog = self.uiDialog,
-                       isResizable = uiDialog.is(':data(resizable)'),
+                       isDraggable = uiDialog.is( ":data(draggable)" ),
+                       isResizable = uiDialog.is( ":data(resizable)" ),
                        resize = false;
 
                switch (key) {
@@ -552,10 +553,12 @@ $.widget("ui.dialog", {
                                }
                                break;
                        case "draggable":
-                               if (value) {
+                               if ( isDraggable && !value ) {
+                                       uiDialog.draggable( "destroy" );
+                               }
+                               
+                               if ( !isDraggable && value ) {
                                        self._makeDraggable();
-                               } else {
-                                       uiDialog.draggable('destroy');
                                }
                                break;
                        case "height":