Use DOMElement methods in set_empty

eb3e557996f0 changed the type of the element passed to set_empty to use
directly the DOMElement. Thus we should use directly the equivalent methods
provided by this interface as it's more efficient anyway.

Closes #14686
This commit is contained in:
Nicolas Évrard
2026-03-17 16:25:14 +01:00
parent e8c0047fca
commit 4eca86d8e7
+8 -5
View File
@@ -722,13 +722,16 @@ function eval_pyson(value){
}
function set_empty(e) {
let empty = true;
for (const child of e.children(':not(.tooltip)')) {
if (jQuery(child).css('display') != 'none') {
for (let child of e.children) {
if (child.classList.contains('tooltip')) {
continue;
}
if (child.style.display != 'none') {
empty = false;
break;
}
}
e.toggleClass('empty', empty);
e.classList.toggle('empty', empty);
};
var col_start, col_end, row_start, row_end;
let style;
@@ -750,13 +753,13 @@ function eval_pyson(value){
var row, col;
for (i = 0; i < grid_cols.length; i++) {
col = cols[i];
if (col.every(e => e.hasClass('empty'))) {
if (col.every(e => e.classList.contains('empty'))) {
grid_cols[i] = "0px";
}
}
for (i = 0; i < grid_rows.length; i++) {
row = rows[i];
if (row.every(e => e.hasClass('empty'))) {
if (row.every(e => e.classList.contains('empty'))) {
grid_rows[i] = "0px";
}
}