Skip to content

Commit

Permalink
Dialog: Update position option after drag. Fixes #4679 - Dialogs shou…
Browse files Browse the repository at this point in the history
…ld remember their position after drag.

Thanks wewals.
  • Loading branch information
scottgonzalez committed Jul 23, 2009
1 parent 1df4659 commit d6f7a57
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/ui.dialog.js
Expand Up @@ -308,6 +308,7 @@ $.widget("ui.dialog", {
_makeDraggable: function() {
var self = this,
options = self.options,
doc = $(document),
heightBeforeDrag;

self.uiDialog.draggable({
Expand All @@ -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();
Expand Down

0 comments on commit d6f7a57

Please sign in to comment.