Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbintb committed Nov 9, 2024
1 parent 92acbfa commit 7e527ea
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
3 changes: 2 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ simplify check-all logic
https://jsfiddle.net/m3jpghb8/
setup valkey persistence
always says laurel not installed
restoring defaults on settings page not working for shares
restoring defaults on settings page not working for shares
bug: if group is collapsed and header icon clicked, it is 'selected' but rows don't get simulated click
33 changes: 33 additions & 0 deletions php/dirt.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,39 @@ function convertFileSize(size) {
}
});

function simulateClicksOnGroupCells(group, id) {
const rows = group.getRows();
const action = id[1] === 'fa-link' ? 'link' : 'delete';
rows.forEach(row => {
if (!row.getElement().classList.contains('disabled')) {
// console.error(id)
// id.selected = !id.selected;
// console.error(id.selected)
// var bool = rows.length !== table.getDataCount();
const cell = row.getElement().querySelector(`.${id[0]}.${id[1]}`);
if (id.selected === row.getElement().querySelector(`input[type="checkbox"]#${action}`).checked) {
console.error('================')
console.error(id.selected)
console.error(action)
console.error(row.getElement().querySelector(`input[type="checkbox"]#${action}`).checked)
console.error('================')
const event = new MouseEvent('click', {
bubbles: true,
cancelable: true,
view: window
});
cell.dispatchEvent(event);
}
}
});
}

table.on("groupClick", function(e, group) {
let id = e.target.classList
id.selected = id.selected === undefined ? false : !id.selected;
simulateClicksOnGroupCells(group, id);
});

table.on("tableBuilt", function () {
let totalSum = 0;
this.getData().forEach(row => {
Expand Down

0 comments on commit 7e527ea

Please sign in to comment.