isStyleInViewport(style) {
    const { pageYOffset, pageXOffset } = window
    const { clientWidth, clientHeight } = document.documentElement

    const element = {
      top: style.top,
      left: style.left,
      width: this.popupCoords.width,
      height: this.popupCoords.height,
    }
    if (_.isNumber(style.right)) {
      element.left = clientWidth - style.right - element.width
    }
    if (_.isNumber(style.bottom)) {
      element.top = clientHeight - style.bottom - element.height
    }

    // hidden on top
    if (element.top < pageYOffset) return false
    // hidden on the bottom
    if (element.top + element.height > pageYOffset + clientHeight) return false
    // hidden the left
    if (element.left < pageXOffset) return false
    // hidden on the right
    if (element.left + element.width > pageXOffset + clientWidth) return false

    return true
  }
// the popup outside of the view port
the popup outside of the view port
the popup outside of the view port
isStyleInViewport(style) {
    const { pageYOffset, pageXOffset } = window
    const { clientWidth, clientHeight } = document.documentElement
    const element = {
      top: style.top,
      left: style.left,
      width: this.popupCoords.width,
      height: this.popupCoords.height,
    }
    if (_.isNumber(style.right)) {
      element.left = clientWidth - style.right - element.width
    }
    if (_.isNumber(style.bottom)) {
      element.top = clientHeight - style.bottom - element.height
    }
    if (element.top < pageYOffset) return false
    if (element.top + element.height > pageYOffset + clientHeight) return false
    if (element.left < pageXOffset) return false
    if (element.left + element.width > pageXOffset + clientWidth) return false
    return true
  }
isStyleInViewport ( style ) { const { pageYOffset , pageXOffset } = window const { clientWidth , clientHeight } = document . documentElement const element = { top : style . top , left : style . left , width : this . popupCoords . width , height : this . popupCoords . height , } if ( _ . isNumber ( style . right ) ) { element . left = clientWidth - style . right - element . width } if ( _ . isNumber ( style . bottom ) ) { element . top = clientHeight - style . bottom - element . height } if ( element . top < pageYOffset ) return false if ( element . top + element . height > pageYOffset + clientHeight ) return false if ( element . left < pageXOffset ) return false if ( element . left + element . width > pageXOffset + clientWidth ) return false return true }
the popup outside of the view port
the popup outside of the view port
// hidden on top // hidden on the bottom // hidden the left // hidden on the right