Browse Source

Fix feedback

pull/839/head
Tim van der Lippe 9 years ago
parent
commit
238216d8c9
  1. 22
      Sortable.html
  2. 3
      Sortable.js

22
Sortable.html

@ -64,13 +64,13 @@
options[key] = this[key]; options[key] = this[key];
}.bind(this)); }.bind(this));
var self = this; var _this = this;
var eventCallbacks = { var eventCallbacks = {
onUpdate: function (e) { onUpdate: function (e) {
if (template) { if (template) {
template.splice("items", e.newIndex, 0, template.splice("items", e.oldIndex, 1)[0]); template.splice("items", e.newIndex, 0, template.splice("items", e.oldIndex, 1)[0]);
} }
self.fire("update", e); _this.fire("update", e);
}, },
onAdd: function(e) { onAdd: function(e) {
@ -80,42 +80,42 @@
var item = from.items[e.oldIndex]; var item = from.items[e.oldIndex];
template.splice("items", e.newIndex, 0, item); template.splice("items", e.newIndex, 0, item);
} }
self.fire("add", e); _this.fire("add", e);
}, },
onRemove: function(e) { onRemove: function(e) {
if (template) { if (template) {
template.splice("items", e.oldIndex, 1)[0]; template.splice("items", e.oldIndex, 1)[0];
} }
self.fire("remove", e); _this.fire("remove", e);
}, },
onChoose: function(e) { onChoose: function(e) {
self.fire("choose", e); _this.fire("choose", e);
}, },
onStart: function(e) { onStart: function(e) {
self.fire("start", e); _this.fire("start", e);
}, },
onEnd: function(e) { onEnd: function(e) {
self.fire("end", e); _this.fire("end", e);
}, },
onSort: function(e) { onSort: function(e) {
self.fire("sort", e); _this.fire("sort", e);
}, },
onFilter: function(e) { onFilter: function(e) {
self.fire("filter", e); _this.fire("filter", e);
}, },
onMove: function(e) { onMove: function(e) {
self.fire("move", e); _this.fire("move", e);
}, },
onClone: function(e) { onClone: function(e) {
self.fire("clone", e); _this.fire("clone", e);
} }
}; };

3
Sortable.js

@ -744,9 +744,8 @@
target.parentNode.insertBefore(dragEl, after ? nextSibling : target); target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
} }
} }
if (dragEl) {
parentEl = dragEl.parentNode; // actualization parentEl = dragEl.parentNode; // actualization
}
this._animate(dragRect, dragEl); this._animate(dragRect, dragEl);
this._animate(targetRect, target); this._animate(targetRect, target);

Loading…
Cancel
Save