sticky-events.js
function getSentinelPosition(stickyElement, sentinel, className) {
  const stickyStyle = window.getComputedStyle(stickyElement);
  const parentStyle = window.getComputedStyle(stickyElement.parentElement);

  switch (className) {
    case ClassName.SENTINEL_TOP:
      return {
        top: `calc(${stickyStyle.getPropertyValue('top')} * -1)`,
        height: 0,
      };

    case ClassName.SENTINEL_BOTTOM:
      const parentPadding = parseInt(parentStyle.paddingTop);

      return {
        bottom: stickyStyle.top,
        height: `${stickyElement.getBoundingClientRect().height + parentPadding}px`,
      };
  }
}
function getSentinelPosition(stickyElement, sentinel, className) {
  const stickyStyle = window.getComputedStyle(stickyElement);
  const parentStyle = window.getComputedStyle(stickyElement.parentElement);

  switch (className) {
    case ClassName.SENTINEL_TOP:
      return {
        top: `calc(${stickyStyle.getPropertyValue('top')} * -1)`,
        height: 0,
      };

    case ClassName.SENTINEL_BOTTOM:
      const parentPadding = parseInt(parentStyle.paddingTop);

      return {
        bottom: stickyStyle.top,
        height: `${stickyElement.getBoundingClientRect().height + parentPadding}px`,
      };
  }
}
function getSentinelPosition ( stickyElement , sentinel , className ) { const stickyStyle = window . getComputedStyle ( stickyElement ) ; const parentStyle = window . getComputedStyle ( stickyElement . parentElement ) ; switch ( className ) { case ClassName . SENTINEL_TOP : return { top : ` ${ stickyStyle . getPropertyValue ( 'top' ) } ` , height : 0 , } ; case ClassName . SENTINEL_BOTTOM : const parentPadding = parseInt ( parentStyle . paddingTop ) ; return { bottom : stickyStyle . top , height : ` ${ stickyElement . getBoundingClientRect ( ) . height + parentPadding } ` , } ; } }
Determine the position of the sentinel

@param {Element|Node} stickyElement
@param {Element|Node} sentinel
@param {String} className
@returns {Object}
Determine the position of the sentinel