mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
Moving to node_modules folder to make easier to upgrade
trying to move from Bootstrap 3 to Bootstrap 5
This commit is contained in:
parent
047e363a16
commit
d4d042e041
8460 changed files with 1355889 additions and 547977 deletions
81
node_modules/infinite-scroll/js/button.js
generated
vendored
Normal file
81
node_modules/infinite-scroll/js/button.js
generated
vendored
Normal file
|
@ -0,0 +1,81 @@
|
|||
// button
|
||||
( function( window, factory ) {
|
||||
// universal module definition
|
||||
if ( typeof module == 'object' && module.exports ) {
|
||||
// CommonJS
|
||||
module.exports = factory(
|
||||
window,
|
||||
require('./core'),
|
||||
require('fizzy-ui-utils'),
|
||||
);
|
||||
} else {
|
||||
// browser global
|
||||
factory(
|
||||
window,
|
||||
window.InfiniteScroll,
|
||||
window.fizzyUIUtils,
|
||||
);
|
||||
}
|
||||
|
||||
}( window, function factory( window, InfiniteScroll, utils ) {
|
||||
|
||||
// -------------------------- InfiniteScrollButton -------------------------- //
|
||||
|
||||
class InfiniteScrollButton {
|
||||
constructor( element, infScroll ) {
|
||||
this.element = element;
|
||||
this.infScroll = infScroll;
|
||||
// events
|
||||
this.clickHandler = this.onClick.bind( this );
|
||||
this.element.addEventListener( 'click', this.clickHandler );
|
||||
infScroll.on( 'request', this.disable.bind( this ) );
|
||||
infScroll.on( 'load', this.enable.bind( this ) );
|
||||
infScroll.on( 'error', this.hide.bind( this ) );
|
||||
infScroll.on( 'last', this.hide.bind( this ) );
|
||||
}
|
||||
|
||||
onClick( event ) {
|
||||
event.preventDefault();
|
||||
this.infScroll.loadNextPage();
|
||||
}
|
||||
|
||||
enable() {
|
||||
this.element.removeAttribute('disabled');
|
||||
}
|
||||
|
||||
disable() {
|
||||
this.element.disabled = 'disabled';
|
||||
}
|
||||
|
||||
hide() {
|
||||
this.element.style.display = 'none';
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.element.removeEventListener( 'click', this.clickHandler );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// -------------------------- InfiniteScroll methods -------------------------- //
|
||||
|
||||
// InfiniteScroll.defaults.button = null;
|
||||
|
||||
InfiniteScroll.create.button = function() {
|
||||
let buttonElem = utils.getQueryElement( this.options.button );
|
||||
if ( buttonElem ) {
|
||||
this.button = new InfiniteScrollButton( buttonElem, this );
|
||||
}
|
||||
};
|
||||
|
||||
InfiniteScroll.destroy.button = function() {
|
||||
if ( this.button ) this.button.destroy();
|
||||
};
|
||||
|
||||
// -------------------------- -------------------------- //
|
||||
|
||||
InfiniteScroll.Button = InfiniteScrollButton;
|
||||
|
||||
return InfiniteScroll;
|
||||
|
||||
} ) );
|
Loading…
Add table
Add a link
Reference in a new issue