Remove an unused legacy component
authorAlexander Ebert <ebert@woltlab.com>
Mon, 8 Aug 2022 17:11:05 +0000 (19:11 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 8 Aug 2022 17:11:05 +0000 (19:11 +0200)
wcfsetup/install/files/js/WCF.js

index ac44d7f91517c3a65378578cbf5ead101db678f0..a4caddabca1b45ffe73dff2fa342b98cc7d6e0ef 100755 (executable)
@@ -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.
  */