From f9f21cd6038a1840ee8753171e1c2b93d0ee18dc Mon Sep 17 00:00:00 2001 From: Salvialf Date: Tue, 7 Jul 2026 20:10:04 +0200 Subject: [PATCH] refactor(dom.ui): modernize empty using replaceChildren - Replaces the manual while/removeChild loop with the native replaceChildren() call - Clears all children in a single DOM operation instead of one removeChild per node --- core/dom/dom.ui.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/dom/dom.ui.js b/core/dom/dom.ui.js index 78eaf0b28a..ca2541ef0c 100644 --- a/core/dom/dom.ui.js +++ b/core/dom/dom.ui.js @@ -93,9 +93,7 @@ NodeList.prototype.toggle = function() { return this } Element.prototype.empty = function() { - while (this.firstChild) { - this.removeChild(this.lastChild) - } + this.replaceChildren() return this } NodeList.prototype.empty = function() { @@ -1804,7 +1802,7 @@ var jeeCtxMenu = function(_options) { display: null }) _ctxMenu.seen() - + //Is there use positionning: if (ctxInstance.options.position) { ctxInstance.options.position.apply(ctxInstance, [ctxInstance, _event.clientX, _event.clientY])