Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function onTransitionEnd(el: HTMLElement, callback: () => void) {
// 如果 el 已经被隐藏,则直接调用 callback
if (transitionEnd && (el.offsetWidth || el.offsetWidth)) {
Yox.dom.on(
el,
transitionEnd,
function (event: CustomEventInterface) {
Yox.dom.off(el, transitionEnd, event.listener as Listener)
callback()
}
)
}
else {
Yox.nextTick(callback)
}
}
click: function () {
var me = this;
if (!me.get('mode') || me.get('mode') == 'hover') {
return;
}
me.set({
isShow: !me.get('isShow')
});
Yox.nextTick(function () {
me.setPosition();
});
}
},
export function onTransitionEnd(el: HTMLElement, callback: () => void) {
if (transitionEnd) {
Yox.dom.on(
el,
transitionEnd,
function (event: CustomEvent) {
Yox.dom.off(el, transitionEnd, event.listener as Listener)
callback()
}
)
}
else {
Yox.nextTick(callback)
}
}