1 /*global View render_template panels */
2 var HTMLView = View.extend({
3 _className: 'HTMLView',
6 template: 'html-view-template',
8 init: function(element, model, parent, template) {
9 this._super(element, model, template);
13 .addObserver(this, 'data', this.modelDataChanged.bind(this))
14 .addObserver(this, 'synced', this.modelSyncChanged.bind(this));
16 $('.htmlview', this.element).html(this.model.get('data'));
17 if (!this.model.get('synced')) {
18 this.parent.freeze('Niezsynchronizowany...');
23 modelDataChanged: function(property, value) {
24 $('.htmlview', this.element).html(value);
27 modelSyncChanged: function(property, value) {
29 this.parent.unfreeze();
31 this.parent.freeze('Niezsynchronizowany...');
36 this.model.removeObserver(this);
42 panels['html'] = HTMLView;