mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Dialog: Update position option after drag. Fixes #4679 - Dialogs should remember their position after drag.
Thanks wewals.
This commit is contained in:
parent
1df4659b7d
commit
d6f7a57eb1
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user