demo/bundle.js
/**
               * Scroll handler for the default scroll behavior of the top app bar.
               * @private
               */
Scroll handler for the default scroll behavior of the top app bar.
@private
Scroll handler for the default scroll behavior of the top app bar . @private
topAppBarScrollHandler_() {
                const currentScrollPosition = Math.max(this.adapter_.getViewportScrollY(), 0);
                const diff = currentScrollPosition - this.lastScrollPosition_;
                this.lastScrollPosition_ = currentScrollPosition;
                if (!this.isCurrentlyBeingResized_) {
                  this.currentAppBarOffsetTop_ -= diff;
                  if (this.currentAppBarOffsetTop_ > 0) {
                    this.currentAppBarOffsetTop_ = 0;
                  } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {
                    this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;
                  }
                  this.moveTopAppBar_();
                }
              }
topAppBarScrollHandler_ ( ) { const currentScrollPosition = Math . max ( this . adapter_ . getViewportScrollY ( ) , 0 ) ; const diff = currentScrollPosition - this . lastScrollPosition_ ; this . lastScrollPosition_ = currentScrollPosition ; if ( ! this . isCurrentlyBeingResized_ ) { this . currentAppBarOffsetTop_ -= diff ; if ( this . currentAppBarOffsetTop_ > 0 ) { this . currentAppBarOffsetTop_ = 0 ; } else if ( Math . abs ( this . currentAppBarOffsetTop_ ) > this . topAppBarHeight_ ) { this . currentAppBarOffsetTop_ = - this . topAppBarHeight_ ; } this . moveTopAppBar_ ( ) ; } }
Scroll handler for the default scroll behavior of the top app bar.
Scroll handler for the default scroll behavior of the top app bar .
// If the window is being resized the lastScrollPosition_ needs to be updated but the // current scroll of the top app bar should stay in the same position.