src/main/javascript/scroll/floatz.scroll.scroller.js
/**
	 * Inject scroll plugin.
	 *
	 * @param plugin {ScrollPlugin} Scroll plugin
	 * @returns {Scroller} Scroller for chaining
	 */
Inject scroll plugin.
@param plugin {ScrollPlugin} Scroll plugin
@returns {Scroller} Scroller for chaining
Inject scroll plugin . @param plugin { ScrollPlugin } Scroll plugin @returns { Scroller } Scroller for chaining
plugin(plugin) {
		if (!(plugin instanceof ScrollPlugin)) {
			throw "Plugin must extend class ScrollPlugin";
		}
		plugin.scroller(this);
		this._plugins.push(plugin);
		this.onScroll(() => {
			plugin.onScroll(this);
		});
		this.onScrollBackward(() => {
			plugin.onScrollBackward(this);
		});
		this.onScrollForward(() => {
			plugin.onScrollForward(this);
		});
		return this;
	}
plugin ( plugin ) { if ( ! ( plugin instanceof ScrollPlugin ) ) { throw "Plugin must extend class ScrollPlugin" ; } plugin . scroller ( this ) ; this . _plugins . push ( plugin ) ; this . onScroll ( ( ) => { plugin . onScroll ( this ) ; } ) ; this . onScrollBackward ( ( ) => { plugin . onScrollBackward ( this ) ; } ) ; this . onScrollForward ( ( ) => { plugin . onScrollForward ( this ) ; } ) ; return this ; }
Inject scroll plugin.
Inject scroll plugin .