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