Skip to content

Commit

Permalink
IBX-7301: Added dispatchEvent for ibexa-refresh-main-table-checkbox a…
Browse files Browse the repository at this point in the history
…fter remove row (#39)
  • Loading branch information
mateuszdebinski authored Mar 4, 2024
1 parent e842177 commit f3f6cbf
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
const tableBody = settingsNode.querySelector('.ibexa-table__body');
const emptyPlaceholder = settingsNode.querySelector('.ibexa-table__template--empty-row')?.content.cloneNode(true);
const removedAllRows = checkedRows.length === allRows.length;
const node = settingsNode.querySelector(SELECTOR_COLUMNS_CONTAINER);

if (removedAllRows) {
tableBody.appendChild(emptyPlaceholder);
Expand All @@ -62,6 +63,8 @@
checkbox.dispatchEvent(new Event('change'));
checkbox.closest(SELECTOR_COLUMN).remove();
});

node.closest('.ibexa-table').dispatchEvent(new CustomEvent('ibexa-refresh-main-table-checkbox'));
}, 0);

initColumns(settingsNode);
Expand Down

0 comments on commit f3f6cbf

Please sign in to comment.