Author: damoxc

Revision: 5880

Log:
        fix actually escaping (foolish me had left it commented out) and also 
only update if there has been a change

Diff:
Modified: branches/1.2_RC/deluge/ui/web/js/Deluge.Details.Details.js
===================================================================
--- branches/1.2_RC/deluge/ui/web/js/Deluge.Details.Details.js  2009-10-27 
10:26:59 UTC (rev 5879)
+++ branches/1.2_RC/deluge/ui/web/js/Deluge.Details.Details.js  2009-10-27 
10:34:07 UTC (rev 5880)
@@ -42,6 +42,7 @@
            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 @@
        }, 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 @@
        };
            
        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

Modified: trunk/deluge/ui/web/js/Deluge.Details.Details.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.Details.Details.js    2009-10-27 10:26:59 UTC 
(rev 5879)
+++ trunk/deluge/ui/web/js/Deluge.Details.Details.js    2009-10-27 10:34:07 UTC 
(rev 5880)
@@ -42,6 +42,7 @@
            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 @@
        }, 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 @@
        };
            
        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



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to