mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 18:05:20 +00:00
Merge pull request #1061 from wazuh/issue-1060
Fix duplicated rows when resizing tables
This commit is contained in:
commit
f72cb793c1
@ -68,12 +68,16 @@ app.directive('wzTable', function() {
|
||||
*/
|
||||
const rowSizes = $scope.rowSizes || [15, 13, 11];
|
||||
let doit;
|
||||
// Prevents duplicated rows when resizing
|
||||
let resizing = false;
|
||||
$window.onresize = () => {
|
||||
if(resizing) return;
|
||||
resizing = true;
|
||||
clearTimeout(doit);
|
||||
doit = setTimeout(() => {
|
||||
$scope.rowsPerPage = calcTableRows($window.innerHeight, rowSizes);
|
||||
$scope.itemsPerPage = $scope.rowsPerPage;
|
||||
init();
|
||||
init().then(() => resizing = false).catch(() => resizing = false);
|
||||
}, 150);
|
||||
};
|
||||
$scope.rowsPerPage = calcTableRows($window.innerHeight, rowSizes);
|
||||
|
Loading…
Reference in New Issue
Block a user