X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/ad481d9335cb91f56adfffda3999284f37d37942..d5cf348c60b8ddc92ce9dae6080d3d276696ffec:/project/static/js/views/html.js?ds=sidebyside diff --git a/project/static/js/views/html.js b/project/static/js/views/html.js index 058b0192..4dc3d544 100644 --- a/project/static/js/views/html.js +++ b/project/static/js/views/html.js @@ -31,8 +31,33 @@ var HTMLView = View.extend({ this.freeze('Ładowanie...'); } else if (value == 'saving') { this.freeze('Zapisywanie...'); + } else if (value == 'error') { + this.freeze(this.model.get('error')); } }, + + + render: function() { + $('.html-print-link', this.element).unbind(); + + this._super(); + + $('.html-print-link', this.element).mouseover( + this.printView.bind(this) + ); + }, + + + printView: function(event) { + var base = $(event.target).attr('ui:baseref'); + $(event.target).attr('href', base + "?revision=" + this.model.get('revision') ); + + return true; + }, + + reload: function() { + this.model.load(true); + }, dispose: function() { this.model.removeObserver(this);