- this.editor.setCode(this.model.xml);
- $(this.model).bind('modelxmlchanged.xmlview', this.codeChanged.bind(this));
- this.model.getXML();
+
+ this.model
+ .addObserver(this, 'data', this.modelDataChanged.bind(this))
+ .addObserver(this, 'synced', this.modelSyncChanged.bind(this));
+
+ this.parent.unfreeze();
+
+ this.editor.setCode(this.model.get('data'));
+ if (!this.model.get('synced')) {
+ this.parent.freeze('Niezsynchronizowany...');
+ this.model.load();
+ }
+