X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/9a96182c20b31868159f4ddd25bbb46abc4173e3..06c0fd3da81bed89e12e7a30cfc6ff33ddecd075:/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 a7f02dd4..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,6 +38,13 @@ 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() { this.model.load(true);