- modelDataChanged: function(property, value) {
- $('.htmlview', this.element).html(value);
- },
+ modelStateChanged: function(property, value) {
+ if (value == 'synced' || value == 'dirty') {
+ this.unfreeze();
+ } else if (value == 'unsynced') {
+ this.freeze('Niezsynchronizowany...');
+ } else if (value == 'loading') {
+ this.freeze('Ładowanie...');
+ } else if (value == 'saving') {
+ this.freeze('Zapisywanie...');
+ } else if (value == 'error') {
+ this.freeze(this.model.get('error'));
+ }
+ },
+
+ render: function() {
+ this.element.unbind('click');
+
+ if(this.$printLink) this.$printLink.unbind();
+ this._super();
+ this.$printLink = $('.html-print-link', this.element);
+
+ this.element.bind('click', this.itemClicked.bind(this));
+ },