mirror of https://github.com/artf/grapesjs.git
1 changed files with 6 additions and 6 deletions
@ -1,15 +1,15 @@ |
|||
import Backbone from 'backbone'; |
|||
import { Collection } from 'common'; |
|||
import Sector from './Sector'; |
|||
|
|||
export default Backbone.Collection.extend({ |
|||
model: Sector, |
|||
|
|||
export default class Sectors extends Collection { |
|||
initialize() { |
|||
this.listenTo(this, 'reset', this.onReset); |
|||
}, |
|||
} |
|||
|
|||
onReset(models, opts = {}) { |
|||
const prev = opts.previousModels || []; |
|||
prev.forEach(sect => sect.get('properties').reset()); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
Sectors.prototype.model = Sector; |
|||
|
|||
Loading…
Reference in new issue