Fix #1494 zero indexed field list

This commit is contained in:
Nicolas Le Goff
2013-10-01 11:16:56 +02:00
parent 77367557fb
commit bfb27ddced

View File

@@ -27,6 +27,13 @@ define([
// store all single rendered views // store all single rendered views
this.itemViews = []; this.itemViews = [];
// force base 1 indexed
if (this.collection.first().get("sorter") === 0) {
this.collection.each(function (model) {
model.set({'sorter': model.get("sorter") + 1}, {silent: true});
});
}
// rerender whenever there is a change on the collection // rerender whenever there is a change on the collection
this.collection.bind("reset", this.render, this); this.collection.bind("reset", this.render, this);
this.collection.bind("add", this.render, this); this.collection.bind("add", this.render, this);