X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/631815265199e5299369d67a01afd21eb9eddf91..3193141f55df20910cf8ba35f9e669d79c90d3f4:/platforma/static/js/views/html.js diff --git a/platforma/static/js/views/html.js b/platforma/static/js/views/html.js index a3db1d28..fa52bd0f 100644 --- a/platforma/static/js/views/html.js +++ b/platforma/static/js/views/html.js @@ -20,9 +20,12 @@ var HTMLView = View.extend({ modelDataChanged: function(property, value) { $('.htmlview', this.element).html(value); + this.updatePrintLink(); + }, + updatePrintLink: function() { var base = this.$printLink.attr('ui:baseref'); - this.$printLink.attr('href', base + "?revision=" + this.model.get('revision')); + this.$printLink.attr('href', base + "?user="+this.model.document.get('user')+"&revision=" + this.model.get('revision')); }, modelStateChanged: function(property, value) @@ -63,9 +66,7 @@ var HTMLView = View.extend({ if(this.$printLink) this.$printLink.unbind(); this._super(); this.$printLink = $('.html-print-link', this.element); - - var base = this.$printLink.attr('ui:baseref'); - this.$printLink.attr('href', base + "?revision=" + this.model.get('revision')); + this.updatePrintLink(); this.element.bind('click', this.itemClicked.bind(this)); },