_onScrollEnded() {
    let clientW = document.body.clientWidth,
      clientH = document.body.clientHeight,
      scrollY = Properties.isFriendlyIframe
        ? document.getElementById('content').scrollTop
        : window.scrollY,
      currentPage = Math.round(scrollY / clientH), // rounding because the header makes the first page only half a page anyway
      pageType = Router.getPageType(Router.currentRoute),
      fillGaps = true;

    if (
      clientW !== _virtualPageDetails.pageWidth ||
      clientH !== _virtualPageDetails.pageHeight
    ) {
      Logger.warn('Page has been resized!');
      _virtualPageDetails.pageWidth = clientW;
      _virtualPageDetails.pageHeight = clientH;
      fillGaps = false;
    }

    if (Router.canNavigate && currentPage !== _virtualPageDetails[pageType]) {
      if (fillGaps) {
        if (currentPage > _virtualPageDetails[pageType]) {
          for (
            let p = _virtualPageDetails[pageType] + 1;
            p <= currentPage;
            p++
          ) {
            this.fireInteractionVirtualPageViewed(p);
          }
        } else {
          for (
            let p = _virtualPageDetails[pageType] - 1;
            p >= currentPage;
            p--
          ) {
            this.fireInteractionVirtualPageViewed(p);
          }
        }
      } else {
        this.fireInteractionVirtualPageViewed(currentPage);
      }
    }
    _virtualPageDetails[pageType] = currentPage;
  }
/**
   * Fires when the user has stopped scrolling, and checks to see if one or more virtual page events need to be fired.
   * @private
   * @returns {void}
   */
Fires when the user has stopped scrolling, and checks to see if one or more virtual page events need to be fired.
@private
@returns {void}
Fires when the user has stopped scrolling and checks to see if one or more virtual page events need to be fired . @private @returns { void }
_onScrollEnded() {
    let clientW = document.body.clientWidth,
      clientH = document.body.clientHeight,
      scrollY = Properties.isFriendlyIframe
        ? document.getElementById('content').scrollTop
        : window.scrollY,
      currentPage = Math.round(scrollY / clientH), 
      pageType = Router.getPageType(Router.currentRoute),
      fillGaps = true;
    if (
      clientW !== _virtualPageDetails.pageWidth ||
      clientH !== _virtualPageDetails.pageHeight
    ) {
      Logger.warn('Page has been resized!');
      _virtualPageDetails.pageWidth = clientW;
      _virtualPageDetails.pageHeight = clientH;
      fillGaps = false;
    }
    if (Router.canNavigate && currentPage !== _virtualPageDetails[pageType]) {
      if (fillGaps) {
        if (currentPage > _virtualPageDetails[pageType]) {
          for (
            let p = _virtualPageDetails[pageType] + 1;
            p <= currentPage;
            p++
          ) {
            this.fireInteractionVirtualPageViewed(p);
          }
        } else {
          for (
            let p = _virtualPageDetails[pageType] - 1;
            p >= currentPage;
            p--
          ) {
            this.fireInteractionVirtualPageViewed(p);
          }
        }
      } else {
        this.fireInteractionVirtualPageViewed(currentPage);
      }
    }
    _virtualPageDetails[pageType] = currentPage;
  }
_onScrollEnded ( ) { let clientW = document . body . clientWidth , clientH = document . body . clientHeight , scrollY = Properties . isFriendlyIframe ? document . getElementById ( 'content' ) . scrollTop : window . scrollY , currentPage = Math . round ( scrollY / clientH ) , pageType = Router . getPageType ( Router . currentRoute ) , fillGaps = true ; if ( clientW !== _virtualPageDetails . pageWidth || clientH !== _virtualPageDetails . pageHeight ) { Logger . warn ( 'Page has been resized!' ) ; _virtualPageDetails . pageWidth = clientW ; _virtualPageDetails . pageHeight = clientH ; fillGaps = false ; } if ( Router . canNavigate && currentPage !== _virtualPageDetails [ pageType ] ) { if ( fillGaps ) { if ( currentPage > _virtualPageDetails [ pageType ] ) { for ( let p = _virtualPageDetails [ pageType ] + 1 ; p <= currentPage ; p ++ ) { this . fireInteractionVirtualPageViewed ( p ) ; } } else { for ( let p = _virtualPageDetails [ pageType ] - 1 ; p >= currentPage ; p -- ) { this . fireInteractionVirtualPageViewed ( p ) ; } } } else { this . fireInteractionVirtualPageViewed ( currentPage ) ; } } _virtualPageDetails [ pageType ] = currentPage ; }
Fires when the user has stopped scrolling, and checks to see if one or more virtual page events need to be fired.
Fires when the user has stopped scrolling and checks to see if one or more virtual page events need to be fired .
// rounding because the header makes the first page only half a page anyway