From 1e442a17ba38286068eff4e6fec85bcaee55692a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 8 Aug 2022 19:11:05 +0200 Subject: [PATCH] Remove an unused legacy component --- wcfsetup/install/files/js/WCF.js | 98 -------------------------------- 1 file changed, 98 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index ac44d7f915..a4caddabca 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -2121,104 +2121,6 @@ else { }); } -/** - * Executes provided callback if scroll threshold is reached. Usable to determine - * if user reached the bottom of an element to load new elements on the fly. - * - * If you do not provide a value for 'reference' and 'target' it will assume you're - * monitoring page scrolls, otherwise a valid jQuery selector must be provided for both. - * - * @param integer threshold - * @param object callback - * @param string reference - * @param string target - */ -WCF.Action.Scroll = Class.extend({ - /** - * callback used once threshold is reached - * @var object - */ - _callback: null, - - /** - * reference object - * @var jQuery - */ - _reference: null, - - /** - * target object - * @var jQuery - */ - _target: null, - - /** - * threshold value - * @var integer - */ - _threshold: 0, - - /** - * Initializes a new WCF.Action.Scroll object. - * - * @param integer threshold - * @param object callback - * @param string reference - * @param string target - */ - init: function(threshold, callback, reference, target) { - this._threshold = parseInt(threshold); - if (this._threshold === 0) { - console.debug("[WCF.Action.Scroll] Given threshold is invalid, aborting."); - return; - } - - if ($.isFunction(callback)) this._callback = callback; - if (this._callback === null) { - console.debug("[WCF.Action.Scroll] Given callback is invalid, aborting."); - return; - } - - // bind element references - this._reference = $((reference) ? reference : window); - this._target = $((target) ? target : document); - - // watch for scroll event - this.start(); - - // check if browser navigated back and jumped to offset before JavaScript was loaded - this._scroll(); - }, - - /** - * Calculates if threshold is reached and notifies callback. - */ - _scroll: function() { - var $targetHeight = this._target.height(); - var $topOffset = this._reference.scrollTop(); - var $referenceHeight = this._reference.height(); - - // calculate if defined threshold is visible - if (($targetHeight - ($referenceHeight + $topOffset)) < this._threshold) { - this._callback(this); - } - }, - - /** - * Enables scroll monitoring, may be used to resume. - */ - start: function() { - this._reference.on('scroll', $.proxy(this._scroll, this)); - }, - - /** - * Disables scroll monitoring, e.g. no more elements loadable. - */ - stop: function() { - this._reference.off('scroll'); - } -}); - /** * Namespace for date-related functions. */ -- 2.20.1