From 2db942e60619c59f827165b293075ed5341a877f Mon Sep 17 00:00:00 2001 From: ngosang Date: Mon, 20 Jul 2015 02:13:44 +0200 Subject: [PATCH] [Web UI] Massive increase in performance. --- src/webui/www/public/scripts/client.js | 2 +- src/webui/www/public/scripts/dynamicTable.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/webui/www/public/scripts/client.js b/src/webui/www/public/scripts/client.js index 7a58b3e46..b6b0a93ac 100644 --- a/src/webui/www/public/scripts/client.js +++ b/src/webui/www/public/scripts/client.js @@ -174,11 +174,11 @@ window.addEvent('load', function () { response['torrents'][key]['hash'] = key; myTable.updateRowData(response['torrents'][key]); } - myTable.updateTable(full_update); if (response['torrents_removed']) response['torrents_removed'].each(function (hash) { myTable.removeRow(hash); }); + myTable.updateTable(full_update); myTable.altRow(); if (response['server_state']) { var tmp = response['server_state']; diff --git a/src/webui/www/public/scripts/dynamicTable.js b/src/webui/www/public/scripts/dynamicTable.js index cc91669ac..ac1062801 100644 --- a/src/webui/www/public/scripts/dynamicTable.js +++ b/src/webui/www/public/scripts/dynamicTable.js @@ -458,7 +458,13 @@ var dynamicTable = new Class({ data = row[fullUpdate ? 'full_data' : 'data']; tds = tr.getElements('td'); + for (var i = 0; i < this.columns.length; i++) { + if (data.hasOwnProperty(this.columns[i].dataProperties[0])) + this.columns[i].updateTd(tds[i], row); + } + row['data'] = {}; + /* for(var prop in data) for (var i = 0; i < this.columns.length; i++) for (var j = 0; j < this.columns[i].dataProperties.length; j++) @@ -473,6 +479,7 @@ var dynamicTable = new Class({ if (tr.hasClass('selected')) tr.removeClass('selected'); } + */ }, removeRow : function (hash) {