details:   https://code.tryton.org/tryton/commit/2e53db33c262
branch:    default
user:      Nicolas Évrard <[email protected]>
date:      Tue Mar 17 16:25:14 2026 +0100
description:
        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
diffstat:

 sao/src/view/form.js |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r 9b3a8fcbe0f6 -r 2e53db33c262 sao/src/view/form.js
--- a/sao/src/view/form.js      Sat Feb 28 15:26:23 2026 +0100
+++ b/sao/src/view/form.js      Tue Mar 17 16:25:14 2026 +0100
@@ -722,13 +722,16 @@
             }
             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 @@
             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";
                 }
             }

Reply via email to