X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/a3a778ec7c2fe89c4cb48f42be3b0821530199d8..60f59d5903e5f4289d7a4b224c3f05e161395815:/project/static/js/views/html.js?ds=inline diff --git a/project/static/js/views/html.js b/project/static/js/views/html.js index 8057138e..a8eb4d01 100644 --- a/project/static/js/views/html.js +++ b/project/static/js/views/html.js @@ -20,6 +20,9 @@ var HTMLView = View.extend({ modelDataChanged: function(property, value) { $('.htmlview', this.element).html(value); + + var base = this.$printLink.attr('ui:baseref'); + this.$printLink.attr('href', base + "?revision=" + this.model.get('revision')); }, modelStateChanged: function(property, value) { @@ -35,8 +38,17 @@ var HTMLView = View.extend({ this.freeze(this.model.get('error')); } }, + + + render: function() { + if(this.$printLink) this.$printLink.unbind(); + this._super(); + this.$printLink = $('.html-print-link', this.element); + }, - reload: function() {}, + reload: function() { + this.model.load(true); + }, dispose: function() { this.model.removeObserver(this);