From 520697af86dc6add8274a88bf4dcbf5679d81e18 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Wed, 31 Jul 2013 10:45:15 -0400 Subject: [PATCH] Use paginator for actionlog --- www/assets/js/acp.js | 113 +++++++++++++++---------------------------- 1 file changed, 40 insertions(+), 73 deletions(-) diff --git a/www/assets/js/acp.js b/www/assets/js/acp.js index fe9595e7..53f923f7 100644 --- a/www/assets/js/acp.js +++ b/www/assets/js/acp.js @@ -94,48 +94,23 @@ $("#show_actionlog").click(function () { $("#actionlog_filter").click(getActionLog); $("#actionlog_searchbtn").click(function() { var tbl = $("#actionlog table"); - $("#actionlog tbody").remove(); - var actions = $("#actionlog_filter").val(); var sfield = $("#actionlog_sfield").val(); var sval = $("#actionlog_search").val().toLowerCase(); var sort = $("#actionlog_sort").val(); var desc = $("#actionlog_sortorder").val() === "true"; tbl.data("sort_desc", desc); tbl.data("sortby", sort); - var entries = []; - tbl.data("allentries").forEach(function(e) { - if(actions.indexOf(e.action) == -1) - return; - entries.push(e); - }); + var entries = tbl.data("allentries"); entries = entries.filter(function (item, i, arr) { var f = item[sfield]; if(sfield === "time") f = new Date(f).toString().toLowerCase(); return f.indexOf(sval) > -1; }); - $("#actionlog_pagination").remove(); - if(entries.length > 20) { - var pag = $("
").addClass("pagination") - .attr("id", "actionlog_pagination") - .insertAfter($("#actionlog table")); - var btns = $("