コード例 #1
0
ファイル: ons-pull-hook.js プロジェクト: iozkul/OnsenUI
  _destroyEventListeners() {
    this._gestureDetector.off('drag', this._boundOnDrag);
    this._gestureDetector.off('dragstart', this._boundOnDragStart);
    this._gestureDetector.off('dragend', this._boundOnDragEnd);

    this._gestureDetector.dispose();
    this._gestureDetector = null;

    this._scrollElement.parentElement.removeEventListener('scroll', this._boundOnScroll, false);
  }
コード例 #2
0
ファイル: ons-carousel.js プロジェクト: mamiysr/OnsenUI
 _updateSwipeable() {
   if (this._gestureDetector) {
     if (this.swipeable) {
       this._gestureDetector.on('drag dragleft dragright dragup dragdown swipe swipeleft swiperight swipeup swipedown', this._boundOnDrag);
       this._gestureDetector.on('dragend', this._boundOnDragEnd);
     } else {
       this._gestureDetector.off('drag dragleft dragright dragup dragdown swipe swipeleft swiperight swipeup swipedown', this._boundOnDrag);
       this._gestureDetector.off('dragend', this._boundOnDragEnd);
     }
   }
 }