- .addObserver(this, 'reloaded', function() {
- this.editor.setCode(this.model.getData()); this.unfreeze(); }.bind(this))
- .addObserver(this, 'needsReload', function() {
- this.freeze('Niezsynchronizowany'); }.bind(this))
- .addObserver(this, 'dataChanged', this.textDidChange.bind(this));
-
+ .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();
+ }
+