How to use the @polymer/polymer/lib/utils/gestures.addListener function in @polymer/polymer

To help you get started, we’ve selected a few @polymer/polymer 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 alibaba / rax / packages / atag / src / components / swiper / index.js View on Github external
_handleTrackStart = ({ x, y }) => {
    this.dragging = true;

    if (this.timer !== null) {
      clearTimeout(this.timer);
    }

    this.startTranslate = this._getOffset(this.circular ? this.current + 1 : this.current);
    this.startTime = new Date().getTime();
    this.transitionDuration = 0;

    Gestures.addListener(document.documentElement, 'track', this._handleGlobalTrack);
    // Avoid to disable document scroll
    Gestures.setTouchAction(document.documentElement, null);
  };
github alibaba / rax / packages / atag / src / components / view / index.js View on Github external
afterNextRender(this, () => {
      Gestures.addListener(this, 'down', this._handleHoverStart);
      Gestures.addListener(this, 'up', this._handleHoverEnd);
      this.addEventListener('touchmove', this._handleTouchmove);
    });
  }
github alibaba / rax / packages / atag / src / components / swiper / index.js View on Github external
connectedCallback() {
    super.connectedCallback();
    this._childrenObserver = new FlattenedNodesObserver(this, this._handleChildrenChanged);
    this._render();
    Gestures.addListener(this, 'track', this._handleTrack);
    Gestures.setTouchAction(this, 'auto');
  }
github pshihn / emoji-slider / src / emoji-slider.ts View on Github external
private attachTrackHandlers() {
    this.detachTrackHandlers();
    const bar = this.trackBar!;
    addListener(bar, 'up', this.upHandler);
    addListener(bar, 'down', this.downHandler);
    addListener(bar, 'track', this.trackHandler);
    this.addEventListener('keydown', this.keyHandler);
  }
github alibaba / rax / packages / atag / src / components / view / index.js View on Github external
disconnectedCallback() {
    Gestures.addListener(this, 'down', this._handleHoverStart);
    Gestures.addListener(this, 'up', this._handleHoverEnd);
    this.removeEventListener('touchmove', this._handleTouchmove);
  }
github alibaba / rax / packages / atag / src / components / picker / index.html View on Github external
connectedCallback() {
    super.connectedCallback();

    window.addEventListener('_formReset', this._handleReset, true);
    Gestures.addListener(this.$.body, 'track', this._handleTrack);
    this.$.slot.addEventListener('click', this.show);

    this.$.mask.addEventListener('click', this.hide);
    this.$.cancel.addEventListener('click', this.hide);
    this.$.confirm.addEventListener('click', this.confirm);
  }
github alibaba / rax / packages / atag / src / components / slider / index.js View on Github external
connectedCallback() {
    super.connectedCallback();

    Gestures.addListener(this.$.handle, 'track', this._handleTrack);
    window.addEventListener('_formReset', this.handleReset, true);
  }
github pshihn / emoji-slider / src / emoji-slider.ts View on Github external
private attachTrackHandlers() {
    this.detachTrackHandlers();
    const bar = this.trackBar!;
    addListener(bar, 'up', this.upHandler);
    addListener(bar, 'down', this.downHandler);
    addListener(bar, 'track', this.trackHandler);
    this.addEventListener('keydown', this.keyHandler);
  }
github pshihn / emoji-slider / src / emoji-slider.ts View on Github external
private attachTrackHandlers() {
    this.detachTrackHandlers();
    const bar = this.trackBar!;
    addListener(bar, 'up', this.upHandler);
    addListener(bar, 'down', this.downHandler);
    addListener(bar, 'track', this.trackHandler);
    this.addEventListener('keydown', this.keyHandler);
  }