How to use the yox.nextTick function in yox

To help you get started, we’ve selected a few yox examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github divawth / bell-ui / src / components / util.ts View on Github external
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)
  }
}
github divawth / bell-ui / dist / components / tooltip / Tooltip.js View on Github external
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();
            });
        }
    },
github divawth / bell-ui / src / components / util.ts View on Github external
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)
  }
}

yox

A lightweight mvvm framework

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis