From 5a5f102a49e34b15e9e40301648b00d01aff24d1 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 11 Mar 2022 19:27:07 +0530 Subject: [PATCH] even faster admin-support redraw --- www/admin/inner.js | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/www/admin/inner.js b/www/admin/inner.js index 7aa6841eb..b9acc0607 100644 --- a/www/admin/inner.js +++ b/www/admin/inner.js @@ -1095,26 +1095,30 @@ define([ }; var _reorder = function () { - var hashKeys = Object.keys(hashesById); + var orderAnswered = []; + var orderPremium = []; + var orderNormal = []; + var orderClosed = []; - var orderAnswered = hashKeys.filter(function (id) { + Object.keys(hashesById).forEach(function (id) { var d = getTicketData(id); - return d && d.lastAdmin && !d.closed; - }).sort(sort); - var orderPremium = hashKeys.filter(function (id) { - var d = getTicketData(id); - return d && d.premium && !d.lastAdmin && !d.closed; - }).sort(sort); - var orderNormal = hashKeys.filter(function (id) { - var d = getTicketData(id); - return d && !d.premium && !d.lastAdmin && !d.closed; - }).sort(sort); - var orderClosed = hashKeys.filter(function (id) { - var d = getTicketData(id); - return d && d.closed; - }).sort(sort); + if (!d) { return; } + if (d.closed) { + return void orderClosed.push(id); + } + if (d.lastAdmin /* && !d.closed */) { + return void orderAnswered.push(id); + } + if (d.premium /* && !d.lastAdmin && !d.closed */) { + return void orderPremium.push(id); + } + orderNormal.push(id); + //if (!d.premium && !d.lastAdmin && !d.closed) { return void orderNormal.push(id); } + }); + var cols = [$col1, $col2, $col3, $col4]; [orderPremium, orderNormal, orderAnswered, orderClosed].forEach(function (list, j) { + list.sort(sort); list.forEach(function (id, i) { var $t = $div.find('[data-id="'+id+'"]'); var d = getTicketData(id);