Free and Open source Web Builder Framework. Next generation tool for building templates without coding
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
449 B

define([ 'backbone', './Layer'],
function (Backbone, Layer) {
return Backbone.Collection.extend({
model: Layer,
initialize: function(){
this.idx = 1;
this.on('add', this.onAdd);
this.on('reset', this.onReset);
},
onAdd: function(model, c, opts){
if(!opts.noIncrement)
model.set('index', this.idx++);
},
onReset: function(){
this.idx = 1;
},
});
});