diff options
author | moisseev <moiseev@mezonplus.ru> | 2024-02-25 17:59:02 +0300 |
---|---|---|
committer | moisseev <moiseev@mezonplus.ru> | 2024-02-25 17:59:02 +0300 |
commit | 4b07085920b53b71c08d6471089b0eb2ae4c7ed7 (patch) | |
tree | ce29fe7728f2f3e03430dab31412c70726d13585 /interface/js/app/libft.js | |
parent | 945da96f9f16196d3126b968a0095c7d24a40fef (diff) | |
download | rspamd-4b07085920b53b71c08d6471089b0eb2ae4c7ed7.tar.gz rspamd-4b07085920b53b71c08d6471089b0eb2ae4c7ed7.zip |
[WebUI] Disable buttons until tables are ready
to prevent race conditions
Diffstat (limited to 'interface/js/app/libft.js')
-rw-r--r-- | interface/js/app/libft.js | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/interface/js/app/libft.js b/interface/js/app/libft.js index 14ef458f6..1e9cbf9a1 100644 --- a/interface/js/app/libft.js +++ b/interface/js/app/libft.js @@ -231,7 +231,7 @@ define(["jquery", "app/common", "footable"], } }; - ui.initHistoryTable = function (data, items, table, columns, expandFirst) { + ui.initHistoryTable = function (data, items, table, columns, expandFirst, postdrawCallback) { /* eslint-disable no-underscore-dangle */ FooTable.Cell.extend("collapse", function () { // call the original method @@ -339,7 +339,8 @@ define(["jquery", "app/common", "footable"], detail_row.find(".btn-sym-" + table + "-" + order) .addClass("active").siblings().removeClass("active"); }, 5); - } + }, + "postdraw.ft.table": postdrawCallback } }); }; @@ -508,19 +509,5 @@ define(["jquery", "app/common", "footable"], return {items: items, symbols: unsorted_symbols}; }; - ui.waitForRowsDisplayed = function (table, rows_total, callback, iteration) { - let i = (typeof iteration === "undefined") ? 10 : iteration; - const num_rows = $("#historyTable_" + table + " > tbody > tr:not(.footable-detail-row)").length; - if (num_rows === common.page_size[table] || - num_rows === rows_total) { - return callback(); - } else if (--i) { - setTimeout(() => { - ui.waitForRowsDisplayed(table, rows_total, callback, i); - }, 500); - } - return null; - }; - return ui; }); |