|
|
|
@ -13,6 +13,7 @@ module.exports = Backbone.View.extend({ |
|
|
|
this.id = this.pfx + model.get('id'); |
|
|
|
this.listenTo(model, 'change:appendContent', this.appendContent); |
|
|
|
this.listenTo(model, 'change:content', this.updateContent); |
|
|
|
this.listenTo(model, 'change:visible', this.toggleVisible); |
|
|
|
model.view = this; |
|
|
|
}, |
|
|
|
|
|
|
|
@ -30,6 +31,14 @@ module.exports = Backbone.View.extend({ |
|
|
|
this.$el.html(this.model.get('content')); |
|
|
|
}, |
|
|
|
|
|
|
|
toggleVisible() { |
|
|
|
if (!this.model.get('visible')) { |
|
|
|
this.$el.addClass(`${this.ppfx}hidden`); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.$el.removeClass(`${this.ppfx}hidden`); |
|
|
|
}, |
|
|
|
|
|
|
|
attributes() { |
|
|
|
return this.model.get('attributes'); |
|
|
|
}, |
|
|
|
|