aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2009-07-23 02:47:38 +0000
committerScott González <scott.gonzalez@gmail.com>2009-07-23 02:47:38 +0000
commitd6f7a57eb1c8962a6affffcad542a2751c1f56ea (patch)
tree1564d688a879b10590b24371a9716630949a7923
parent1df4659b7d707987bd18c098eb0ff32e27a1fba4 (diff)
downloadjquery-ui-d6f7a57eb1c8962a6affffcad542a2751c1f56ea.tar.gz
jquery-ui-d6f7a57eb1c8962a6affffcad542a2751c1f56ea.zip
Dialog: Update position option after drag. Fixes #4679 - Dialogs should remember their position after drag.
Thanks wewals.
-rw-r--r--ui/ui.dialog.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js
index 299f744b8..777cc3490 100644
--- a/ui/ui.dialog.js
+++ b/ui/ui.dialog.js
@@ -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();