From e17bd472a85723c7c3259ff570f579984620262d Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Tue, 27 Oct 2009 10:34:07 +0000 Subject: [PATCH] fix actually escaping (foolish me had left it commented out) and also only update if there has been a change --- deluge/ui/web/js/Deluge.Details.Details.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/deluge/ui/web/js/Deluge.Details.Details.js b/deluge/ui/web/js/Deluge.Details.Details.js index 0d10a4259..98c8ef68e 100644 --- a/deluge/ui/web/js/Deluge.Details.Details.js +++ b/deluge/ui/web/js/Deluge.Details.Details.js @@ -42,6 +42,7 @@ Ext.deluge.details.DetailsTab = Ext.extend(Ext.Panel, { url: '/render/tab_details.html', text: _('Loading') + '...' }); + this.oldData = {}; this.body.setStyle('padding', '5px'); this.getUpdater().on('update', this.onPanelUpdate, this); }, @@ -68,10 +69,10 @@ Ext.deluge.details.DetailsTab = Ext.extend(Ext.Panel, { }, this); }, - onRequestComplete: function(torrent, options) { + onRequestComplete: function(torrent, request, response, options) { var data = { torrent_name: torrent.name, - hash: options.torrentId, + hash: options.options.torrentId, path: torrent.save_path, size: fsize(torrent.total_size), files: torrent.num_files, @@ -81,9 +82,10 @@ Ext.deluge.details.DetailsTab = Ext.extend(Ext.Panel, { }; for (var field in this.fields) { - //this.fields[field].innerHTML = Ext.escapeHTML(data[field]); - this.fields[field].innerHTML = data[field]; + if (data[field] == this.oldData[field]) continue; + this.fields[field].innerHTML = Ext.escapeHTML(data[field]); } + this.oldData = data; } }); Deluge.Details.add(new Ext.deluge.details.DetailsTab()); \ No newline at end of file