Skip to content

Commit

Permalink
feat(draggable): Don't start new drag if previous one hasn't stopped
Browse files Browse the repository at this point in the history
Moving 4e6159f by @atesgoral into draggable.js
  • Loading branch information
vieron committed Oct 26, 2013
1 parent 4b1b2b7 commit 91ca657
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 4 additions & 2 deletions src/jquery.draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,10 @@

fn.on_dragstart = function(e) {
e.preventDefault();
this.drag_start = true;
this.is_dragging = true;

if (this.is_dragging) { return this; }

this.drag_start = this.is_dragging = true;
var offset = this.$container.offset();
this.baseX = Math.round(offset.left);
this.baseY = Math.round(offset.top);
Expand Down
8 changes: 0 additions & 8 deletions src/jquery.gridster.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,13 +661,6 @@
offset_left: this.options.widget_margins[0],
container_width: this.container_width,
start: function(event, ui) {
// Ignore drag start if mouse was released outside screen on a previous drag
if (self.dragging) {
return;
}

self.dragging = true;

self.$widgets.filter('.player-revert')
.removeClass('player-revert');

Expand All @@ -680,7 +673,6 @@
self.$el.trigger('gridster:dragstart');
},
stop: function(event, ui) {
self.dragging = false;
self.on_stop_drag.call(self, event, ui);
self.$el.trigger('gridster:dragstop');
},
Expand Down

0 comments on commit 91ca657

Please sign in to comment.