From: Scott González Date: Mon, 20 Sep 2010 13:15:28 +0000 (-0400) Subject: Dialog: Don't call draggable.destroy if we're not currently draggable. Fixes #6069... X-Git-Tag: 1.8.6~69 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=98a98a05d1a646a1e53b90020fe7c096acd1d933;p=jquery-ui.git Dialog: Don't call draggable.destroy if we're not currently draggable. Fixes #6069 - DIALOG windows 1.8.5 draggapble problem. --- 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":