@ -2,5 +2,14 @@ import Backbone from 'backbone';
import Sector from './Sector';
export default Backbone.Collection.extend({
model: Sector
model: Sector,
initialize() {
this.listenTo(this, 'reset', this.onReset);
},
onReset(models, opts = {}) {
const prev = opts.previousModels || [];
prev.forEach(sect => sect.get('properties').reset());
}
});
@ -7,6 +7,11 @@ export default PropertyIntegerView.extend({
this.inputInst.setValue(value, opts);
remove() {
PropertyIntegerView.prototype.remove.apply(this, arguments);
['inputInst', '$color'].forEach(i => (this[i] = {}));
onRender() {
if (!this.input) {
const ppfx = this.ppfx;
@ -27,6 +27,12 @@ export default PropertyView.extend({
PropertyView.prototype.clear.apply(this, arguments);
this.model.get('properties').reset();
PropertyView.prototype.remove.apply(this, arguments);
['properties', 'props', '$props'].forEach(i => (this[i] = {}));
/**
* Renders input
* */
@ -95,6 +95,9 @@ export default Backbone.View.extend({
Backbone.View.prototype.remove.apply(this, arguments);
['em', 'target', 'input', '$input', 'propTarget', 'sector'].forEach(
i => (this[i] = {})
);
this.__destroyFn(this._getClbOpts());