r2961 commited - Dialog: Update position option after drag. Fixes #4679 - Dialogs shou...

r2961 commited - Dialog: Update position option after drag. Fixes #4679 - Dialogs shou...


Revision: 2961
Author: scott.gonzalez
Date: Wed Jul 22 19:47:38 2009
Log: Dialog: Update position option after drag. Fixes #4679 - Dialogs
should remember their position after drag.
Thanks wewals.
http://code.google.com/p/jquery-ui/source/detail?r=2961
Modified:
/trunk/ui/ui.dialog.js
=======================================
--- /trunk/ui/ui.dialog.js    Mon Jul 20 17:03:39 2009
+++ /trunk/ui/ui.dialog.js    Wed Jul 22 19:47:38 2009
@@ -308,6 +308,7 @@
    _makeDraggable: function() {
        var self = this,
            options = self.options,
+            doc = $(document),
            heightBeforeDrag;
        self.uiDialog.draggable({
@@ -322,7 +323,9 @@
            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();