How to use the @egjs/flicking.EVENTS function in @egjs/flicking

To help you get started, we’ve selected a few @egjs/flicking 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 naver / egjs-flicking / packages / ngx-flicking / projects / ngx-flicking / src / lib / ngx-flicking.component.ts View on Github external
private bindEvents() {
    const events = Object.keys(NativeFlicking.EVENTS)
      .map(key => NativeFlicking.EVENTS[key]);

    events.forEach(eventName => {
      this.flicking.on(eventName, e => {
        e.currentTarget = this;
        const emitter = this[eventName]; // Style guide: Event - https://angular.io/guide/styleguide#dont-prefix-output-properties

        if (emitter) {
          emitter.emit(e);

          if (eventName === 'visibleChange') {
            const list = this.counter(this.panels.length * (this.flicking.getCloneCount() + 1));
            const min = e.range.min;
            const max = e.range.max;

            const visibles = min >= 0
github naver / egjs-flicking / packages / vue-flicking / src / Flicking.ts View on Github external
private $_bindEvents() {
    const events = Object.keys(NativeFlicking.EVENTS)
      .map(key => NativeFlicking.EVENTS[key]);

    events.forEach(eventName => {
      this.$_nativeFlicking.on(eventName, e => {
        e.currentTarget = this;
        // Make events from camelCase to kebab-case
        this.$emit(eventName.replace(/([A-Z])/g, "-$1").toLowerCase(), e);
      });
    });

    if (this.options.renderOnlyVisible) {
      this.$_nativeFlicking.on(NativeFlicking.EVENTS.VISIBLE_CHANGE, e => {
        this.$forceUpdate();
      });
    }
  }