|
|
@ -90,6 +90,7 @@ export default Backbone.View.extend({ |
|
|
['change:layerable', this.updateLayerable], |
|
|
['change:layerable', this.updateLayerable], |
|
|
['change:style:display', this.updateVisibility], |
|
|
['change:style:display', this.updateVisibility], |
|
|
['rerender:layer', this.render], |
|
|
['rerender:layer', this.render], |
|
|
|
|
|
['change:name change:custom-name', this.updateName], |
|
|
].forEach((item) => this.listenTo(model, item[0], item[1])); |
|
|
].forEach((item) => this.listenTo(model, item[0], item[1])); |
|
|
this.className = `${pfx}layer ${pfx}layer__t-${type} no-select ${ppfx}two-color`; |
|
|
this.className = `${pfx}layer ${pfx}layer__t-${type} no-select ${ppfx}two-color`; |
|
|
this.inputNameCls = `${ppfx}layer-name`; |
|
|
this.inputNameCls = `${ppfx}layer-name`; |
|
|
@ -112,6 +113,10 @@ export default Backbone.View.extend({ |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
updateName() { |
|
|
|
|
|
this.getInputName().innerText = this.model.getName(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
getVisibilityEl() { |
|
|
getVisibilityEl() { |
|
|
if (!this.eyeEl) { |
|
|
if (!this.eyeEl) { |
|
|
this.eyeEl = this.$el.children(`.${this.pfx}layer-vis`); |
|
|
this.eyeEl = this.$el.children(`.${this.pfx}layer-vis`); |
|
|
|