updates
This commit is contained in:
+9
-7
@@ -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;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user