From 98a98a05d1a646a1e53b90020fe7c096acd1d933 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 20 Sep 2010 09:15:28 -0400 Subject: Dialog: Don't call draggable.destroy if we're not currently draggable. Fixes #6069 - DIALOG windows 1.8.5 draggapble problem. --- ui/jquery.ui.dialog.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index c7ef437fc..029f91905 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -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": -- cgit v1.2.3