]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Update position option after drag. Fixes #4679 - Dialogs should remember...
authorScott González <scott.gonzalez@gmail.com>
Thu, 23 Jul 2009 02:47:38 +0000 (02:47 +0000)
committerScott González <scott.gonzalez@gmail.com>
Thu, 23 Jul 2009 02:47:38 +0000 (02:47 +0000)
Thanks wewals.

ui/ui.dialog.js

index 299f744b821db871918447cc5fff2d8ef922e6d0..777cc3490d75f311f748c8789c84a3eb60576998 100644 (file)
@@ -308,6 +308,7 @@ $.widget("ui.dialog", {
        _makeDraggable: function() {
                var self = this,
                        options = self.options,
+                       doc = $(document),
                        heightBeforeDrag;
 
                self.uiDialog.draggable({
@@ -322,7 +323,9 @@ $.widget("ui.dialog", {
                        drag: function(event) {
                                self._trigger('drag', event);
                        },
-                       stop: function(event) {
+                       stop: function(event, ui) {
+                               options.position = [ui.position.left - doc.scrollLeft(),
+                                       ui.position.top - doc.scrollTop()];
                                $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
                                self._trigger('dragStop', event);
                                $.ui.dialog.overlay.resize();