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
*/
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;
},