This commit is contained in:
2026-06-17 00:47:12 +03:00
parent ddfeae6cd1
commit 029b18dd68
+9 -7
View File
@@ -810,14 +810,16 @@
/** /**
* Slide Toggle * Slide Toggle
*/ */
slideToggle(callback, force) { slideToggle(...a) {
if (window.getComputedStyle(this).getPropertyValue('display') == 'none') { const isBool = typeof a[0] === 'boolean';
domUtils.slideDown.call(this, callback, force);
return this;
}
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; return this;
}, },