Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
resize() {
if (this.is('initialized') && !this.is('collapsed')) {
this.$content.style.height = `${outerHeight(this.$contentinner)}px`
this.trigger(EVENTS.RESIZE)
}
}
getSize() {
this.containerWidth = parseInt(outerWidth(this.container), 10)
this.containerHeight = parseInt(outerHeight(this.container), 10)
this.width = parseInt(outerWidth(this.element), 10)
this.height = parseInt(outerHeight(this.element), 10)
this.distance = this.getDistance()
}
{
transform: 'translateY(-50%)',
opacity: '0',
[direction]: 'auto'
},
$pane
)
)
this.instance.$contentInners.map($item =>
setStyle(direction, 'auto', $item)
)
setStyle(
'height',
outerHeight(this.instance.$contentInners[this.index]),
this.instance.element
)
}
setDistance(vertical) {
this.wrapDistance = vertical
? outerHeight(this.element)
: outerWidth(this.element)
this.innerDistance = vertical
? this.inner.scrollHeight
: this.inner.scrollWidth
}
this.length = this.items.length
this.distance = 0
this.gutter =
this.length > 0
? parseInt(
window.getComputedStyle(this.items[1])[
vertical ? 'margin-top' : 'margin-left'
],
10
)
: 0
if (this.length > 0) {
this.distance = vertical
? outerHeight(this.items[0])
: outerWidth(this.items[0])
}
}
this.$contentinner = children(this.$content)[0]
addClass(this.classes.CONTENTINNER, this.$contentinner)
}
addClass(this.classes.CONTAINER, this.element)
if (this.options.theme) {
addClass(this.getThemeClass(), this.element)
}
this.addA11yAttrs()
this.bind()
if (this.options.collapsed) {
this._collapse()
} else {
this.$content.style.height = `${outerHeight(this.$contentinner)}px`
this._expand()
}
this.enter('initialized')
this.trigger(EVENTS.READY)
}