From aa68c4952d83b254c837115a86f7769d7adf88cb Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Tue, 9 Aug 2016 16:49:14 +0200 Subject: [PATCH] [WebUI] Retain history length on update (#829) --- interface/js/rspamd.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/interface/js/rspamd.js b/interface/js/rspamd.js index 688715e24..6cfca7373 100644 --- a/interface/js/rspamd.js +++ b/interface/js/rspamd.js @@ -556,6 +556,12 @@ function getHistory() { if (history) { + var history_length = document.getElementsByName('historyLog_length')[0]; + if (history_length !== undefined) { + history_length = parseInt(history_length.value); + } else { + history_length = 10; + } history.destroy(); $('#historyLog').children('tbody').remove(); } @@ -608,7 +614,8 @@ }); $('', { html: items.join('') }).insertAfter('#historyLog thead'); history = $('#historyLog').DataTable({ - "order": [[ 0, "desc" ]] + "order": [[ 0, "desc" ]], + "pageLength": history_length }); } }); -- 2.39.5