X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/a3a778ec7c2fe89c4cb48f42be3b0821530199d8..1eb24182f3aa52108546f0cacd17e52e54a3a57c:/project/static/js/views/html.js diff --git a/project/static/js/views/html.js b/project/static/js/views/html.js index 8057138e..4dc3d544 100644 --- a/project/static/js/views/html.js +++ b/project/static/js/views/html.js @@ -35,8 +35,29 @@ var HTMLView = View.extend({ 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() {}, + reload: function() { + this.model.load(true); + }, dispose: function() { this.model.removeObserver(this);