How to use the yox.dom 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 / component / input-number / InputNumber.ts View on Github external
return
      }
      // 阻止事件默认行为,避免光标的跳动
      switch ((event.originalEvent as KeyboardEvent).keyCode) {
        case 38:
          me.up()
          event.prevent()
          break
        case 40:
          me.down()
          event.prevent()
          break
      }
    }

    Yox.dom.on(
      DOCUMENT,
      RAW_EVENT_KEYDOWN,
      onKeydown
    )

    me.on(
      RAW_EVENT_BEFORE_DESTROY,
      function (event) {
        if (event.phase === Yox.Event.PHASE_CURRENT) {
          Yox.dom.off(
            DOCUMENT,
            RAW_EVENT_KEYDOWN,
            onKeydown
          )
        }
      }
github divawth / bell-ui / src / component / backtop / BackTop.ts View on Github external
me.set({
        visible: containerElement.scrollTop >= height
      })
    }

    const duration = toNumber(this.get('duration'))
    me.on('click', function () {
      scrollTop(
        containerElement,
        containerElement.scrollTop,
        0,
        duration
      )
    })

    Yox.dom.on(container, RAW_EVENT_SCROLL, onRefresh)
    Yox.dom.on(WINDOW, RAW_EVENT_RESIZE, onRefresh)

    me.on(
      RAW_EVENT_BEFORE_DESTROY,
      function (event) {
        if (event.phase === Yox.Event.PHASE_CURRENT) {
          Yox.dom.off(container, RAW_EVENT_SCROLL, onRefresh)
          Yox.dom.off(WINDOW, RAW_EVENT_RESIZE, onRefresh)
        }
      }
    )

  }
github divawth / bell-ui / dist / components / drawer / Drawer.js View on Github external
open: function (isOpen) {
            var me = this, element = this.$el;
            if (isOpen) {
                Yox.dom.addClass(element, CLASS_OPEN);
                onTransitionEnd(element, function () {
                    me.fire('open.drawer');
                });
            }
            else {
                Yox.dom.addClass(element, CLASS_LEAVE);
                onTransitionEnd(element, function () {
                    Yox.dom.removeClass(element, CLASS_OPEN);
                    Yox.dom.removeClass(element, CLASS_LEAVE);
                    me.fire('close.drawer');
                });
            }
        }
    },
github divawth / bell-ui / src / component / dropdown / Dropdown.ts View on Github external
function () {
            Yox.dom.removeClass(element, CLASS_VISIBLE)
          }
        )
github divawth / bell-ui / dist / components / notice / base.js View on Github external
var createNotice = function (data) {
    var namespace = '${prefix}notice-' + id++;
    var body = Yox.dom.find('#${prefix}notice-wrapper');
    var element = Yox.dom.createElement('div');
    Yox.dom.prop(element, 'id', namespace);
    Yox.dom.append(body, element);
    var instance = new Yox({
        el: '#' + namespace,
        replace: TRUE,
        template: template,
        props: {
            title: data.title,
            content: data.content,
            type: data.type,
            duration: data.duration,
            width: data.width,
            right: data.right,
            onClose: data.onClose
        },
github divawth / bell-ui / dist / components / backtop / BackTop.js View on Github external
me.once('beforeDestroy.hook', function () {
            Yox.dom.off(parentElement, 'scroll', onRefresh);
            Yox.dom.off(document, 'resize', onRefresh);
        });
    }
github divawth / bell-ui / src / component / tooltip / Tooltip.ts View on Github external
function () {
            Yox.dom.addClass(popup, CLASS_FADE)
          },
          50
github divawth / bell-ui / dist / components / alert / Alert.js View on Github external
close: function () {
            var me = this;
            Yox.dom.addClass(me.$el, '${prefix}hide');
            onTransitionEnd(me.$el, function () {
                me.$el && me.$el.remove();
                me.fire('close.alert');
            });
        }
    }
github divawth / bell-ui / dist / components / tooltip / Tooltip.js View on Github external
'hasItem.tootipItem': function () {
            var content = this.$refs.contents.getElementsByClassName('${prefix}tooltip-inner-content');
            if (content.length) {
                var innerElement = this.$refs.innerElement;
                for (var i = 0; i < content.length; i++) {
                    Yox.dom.append(innerElement, content[i]);
                }
            }
        }
    },
github divawth / bell-ui / src / components / slider / Slider.ts View on Github external
handleTouchEnd(event: CustomEventInterface) {
      let me = this
      if (me.get('disabled')) {
        return
      }
      Yox.dom.off(
        DOCUMENT,
        'touchmove',
        me.handleTouchMove
      )
      Yox.dom.off(
        DOCUMENT,
        'touchup',
        me.handleTouchEnd
      )
      Yox.dom.off(
        DOCUMENT,
        'touchend',
        me.handleTouchEnd
      )
      Yox.dom.off(
        DOCUMENT,

yox

A lightweight mvvm framework

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis