From 029b18dd687cb76475abb0d17aa7b17770db1c92 Mon Sep 17 00:00:00 2001 From: grainsoft Date: Wed, 17 Jun 2026 00:47:12 +0300 Subject: [PATCH] updates --- src/utils/dom.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/utils/dom.js b/src/utils/dom.js index d4a52d5..903e1c5 100644 --- a/src/utils/dom.js +++ b/src/utils/dom.js @@ -810,14 +810,16 @@ /** * Slide Toggle */ - slideToggle(callback, force) { - - if (window.getComputedStyle(this).getPropertyValue('display') == 'none') { - domUtils.slideDown.call(this, callback, force); - return this; - } + slideToggle(...a) { + + const isBool = typeof a[0] === 'boolean'; - domUtils.slideUp.call(this, callback, force); + const show = isBool + ? a[0] + : getComputedStyle(this).display === 'none'; + + domUtils[show ? 'slideDown' : 'slideUp'] + .call(this, ...(isBool ? [a[1], a[2] ?? false] : [a[0] ?? null, a[1] ?? false])); return this; },