You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
649 B
JavaScript

class delayedLoading extends Paged.Handler {
// this let us call the methods from the the chunker, the polisher and the caller for the rest of the script
constructor(chunker, polisher, caller) {
super(chunker, polisher, caller);
}
beforeParsed (_) {
document.body.appendChild(document.createTextNode('this text was inserted before the slow resolve'));
return new Promise(function (resolve) {
setTimeout(function () {
document.body.appendChild(document.createTextNode('this text was inserted before pagedjs is loaded'));
resolve();
}, 2000);
});
}
}
Paged.registerHandlers(delayedLoading);