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
102
node_modules/infinite-scroll/js/status.js
generated
vendored
Normal file
102
node_modules/infinite-scroll/js/status.js
generated
vendored
Normal file
|
@ -0,0 +1,102 @@
|
|||
// status
|
||||
( 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 ) {
|
||||
|
||||
let proto = InfiniteScroll.prototype;
|
||||
|
||||
// InfiniteScroll.defaults.status = null;
|
||||
|
||||
InfiniteScroll.create.status = function() {
|
||||
let statusElem = utils.getQueryElement( this.options.status );
|
||||
if ( !statusElem ) return;
|
||||
|
||||
// elements
|
||||
this.statusElement = statusElem;
|
||||
this.statusEventElements = {
|
||||
request: statusElem.querySelector('.infinite-scroll-request'),
|
||||
error: statusElem.querySelector('.infinite-scroll-error'),
|
||||
last: statusElem.querySelector('.infinite-scroll-last'),
|
||||
};
|
||||
// events
|
||||
this.on( 'request', this.showRequestStatus );
|
||||
this.on( 'error', this.showErrorStatus );
|
||||
this.on( 'last', this.showLastStatus );
|
||||
this.bindHideStatus('on');
|
||||
};
|
||||
|
||||
proto.bindHideStatus = function( bindMethod ) {
|
||||
let hideEvent = this.options.append ? 'append' : 'load';
|
||||
this[ bindMethod ]( hideEvent, this.hideAllStatus );
|
||||
};
|
||||
|
||||
proto.showRequestStatus = function() {
|
||||
this.showStatus('request');
|
||||
};
|
||||
|
||||
proto.showErrorStatus = function() {
|
||||
this.showStatus('error');
|
||||
};
|
||||
|
||||
proto.showLastStatus = function() {
|
||||
this.showStatus('last');
|
||||
// prevent last then append event race condition from showing last status #706
|
||||
this.bindHideStatus('off');
|
||||
};
|
||||
|
||||
proto.showStatus = function( eventName ) {
|
||||
show( this.statusElement );
|
||||
this.hideStatusEventElements();
|
||||
let eventElem = this.statusEventElements[ eventName ];
|
||||
show( eventElem );
|
||||
};
|
||||
|
||||
proto.hideAllStatus = function() {
|
||||
hide( this.statusElement );
|
||||
this.hideStatusEventElements();
|
||||
};
|
||||
|
||||
proto.hideStatusEventElements = function() {
|
||||
for ( let type in this.statusEventElements ) {
|
||||
let eventElem = this.statusEventElements[ type ];
|
||||
hide( eventElem );
|
||||
}
|
||||
};
|
||||
|
||||
// -------------------------- -------------------------- //
|
||||
|
||||
function hide( elem ) {
|
||||
setDisplay( elem, 'none' );
|
||||
}
|
||||
|
||||
function show( elem ) {
|
||||
setDisplay( elem, 'block' );
|
||||
}
|
||||
|
||||
function setDisplay( elem, value ) {
|
||||
if ( elem ) {
|
||||
elem.style.display = value;
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------- -------------------------- //
|
||||
|
||||
return InfiniteScroll;
|
||||
|
||||
} ) );
|
Loading…
Add table
Add a link
Reference in a new issue