Skip to content

Commit

Permalink
feat(draggable): new config option to move or not the dragged element
Browse files Browse the repository at this point in the history
  • Loading branch information
vieron committed Oct 26, 2013
1 parent 0f95624 commit 4d9b2a8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/jquery.draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
autoscroll: true,
ignore_dragging: ['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON'],
handle: null,
container_width: 0 // 0 == auto
container_width: 0, // 0 == auto
move_element: true,
helper: false // or 'clone'
// drag: function(e){},
// start : function(e, ui){},
Expand Down Expand Up @@ -283,11 +284,13 @@

this.options.autoscroll && this.manage_scroll(data);

(this.helper ? this.$helper : this.$player).css({
'position': 'absolute',
'left' : offset.left,
'top' : offset.top
});
if (this.options.move_element) {
(this.helper ? this.$helper : this.$player).css({
'position': 'absolute',
'left' : data.position.left,
'top' : data.position.top
});
}

var last_position = this.last_position || data.position;
data.prev_position = last_position;
Expand Down

0 comments on commit 4d9b2a8

Please sign in to comment.