From 60f59d5903e5f4289d7a4b224c3f05e161395815 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Rekucki?= Date: Mon, 5 Oct 2009 13:24:02 +0200 Subject: [PATCH] Fix in the print button. --- project/static/js/views/html.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/project/static/js/views/html.js b/project/static/js/views/html.js index 4dc3d544..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) { @@ -38,21 +41,9 @@ var HTMLView = View.extend({ render: function() { - $('.html-print-link', this.element).unbind(); - + if(this.$printLink) this.$printLink.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; + this.$printLink = $('.html-print-link', this.element); }, reload: function() { -- 2.20.1