Browse Source

Update the sorter index, try to use the one from the model

pull/2031/head
Artur Arseniev 8 years ago
parent
commit
d028e568e1
  1. 7
      src/utils/Sorter.js

7
src/utils/Sorter.js

@ -6,7 +6,8 @@ import {
matches, matches,
getElement, getElement,
getPointerEvent, getPointerEvent,
isTextNode isTextNode,
getModel
} from 'utils/mixins'; } from 'utils/mixins';
const $ = Backbone.$; const $ = Backbone.$;
@ -823,6 +824,8 @@ module.exports = Backbone.View.extend({
for (var i = 0, len = ch.length; i < len; i++) { for (var i = 0, len = ch.length; i < len; i++) {
var el = ch[i]; var el = ch[i];
const model = getModel(el, $);
const elIndex = model ? model.index() : i;
if (!isTextNode(el) && !this.matches(el, this.itemSel)) { if (!isTextNode(el) && !this.matches(el, this.itemSel)) {
continue; continue;
@ -835,7 +838,7 @@ module.exports = Backbone.View.extend({
else if (dir == 'h') dir = false; else if (dir == 'h') dir = false;
else dir = this.isInFlow(el, trg); else dir = this.isInFlow(el, trg);
dim.push(dir, el, indexOf(trg.childNodes, el)); dim.push(dir, el, elIndex);
dims.push(dim); dims.push(dim);
} }

Loading…
Cancel
Save