checkVisibility(parent, direction) {
		if (!this.active) {
			return this.visible
		}

		const parentWidth = parent.offsetWidth || parent.innerWidth || 0
		const parentHeight = parent.offsetHeight || parent.innerHeight || 0

		const parentFrame = { w: parentWidth, h: parentHeight }
		const rect = this.getBounds()

		const visible = this._checkVisibility(rect, parentFrame, direction)

		if (visible !== this.visible) {
			this.visible = visible

			const response = this._toggleCallback()

			if (response instanceof Promise) {
					response.then(this._toggleClass.bind(this)).catch(e => {
						console.error('Trigger promise failed')
						console.error(e)
					})
			} else {
					this._toggleClass()
			}

			if (this.visible && this.once) {
				this.active = false
			}
		} else if (visible) {
				if (typeof this.toggle.callback.visible == 'function') {
						return this.toggle.callback.visible.call(this.element, this)
				}
		}

		return visible
	}
Checks if the Trigger is in the viewport, calls the callbacks and toggles the classes
@param {HTMLElement|HTMLDocument|Window} parent
@param {string} direction top, bottom, left, right
@returns {boolean} If the element is visible