feat(draggable): Don't start new drag if previous one hasn't stopped

Moving 4e6159fb by @atesgoral into draggable.js
This commit is contained in:
vieron
2013-10-25 20:48:10 +02:00
parent 4b1b2b7259
commit 91ca65721c
2 changed files with 4 additions and 10 deletions

View File

@@ -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);

View File

@@ -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');
@@ -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');
},