MCPcopy Index your code
hub / github.com/hoothin/UserScripts / beginLoading

Method beginLoading

Pagetual/pagetual.user.js:7676–7703  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7674 }
7675
7676 beginLoading() {
7677 isLoading = true;
7678 if (targetY >= 0) {
7679 window.scrollTo({ top: targetY, behavior: 'instant'});
7680 targetY = -1;
7681 }
7682 let lastScrollTop = getBody(document).scrollTop || document.documentElement.scrollTop;
7683 ruleParser.insertElement(loadingDiv);
7684 if (forceState == 2) {
7685 getBody(document).appendChild(loadingDiv);
7686 } else {
7687 let parent = loadingDiv.parentNode;
7688 if (compareNodeName(parent, ["tbody"])) {
7689 parent = parent.parentNode;
7690 }
7691 if (compareNodeName(parent, ["table"])) {
7692 parent.parentNode.appendChild(loadingDiv);
7693 }
7694 if (loadingDiv.previousElementSibling) {
7695 let preStyle = _unsafeWindow.getComputedStyle(loadingDiv.previousElementSibling);
7696 if (preStyle.order && preStyle.order !== '0') loadingDiv.style.order = preStyle.order;
7697 }
7698 }
7699 //this.setPageTop(lastScrollTop);
7700 if (sideController.inited) {
7701 sideController.frame.classList.add("pagetual-sideController-loading");
7702 }
7703 }
7704
7705 async insertElement(ele) {
7706 if (!this.insert || !this.insert.parentNode) {

Callers 1

nextPageFunction · 0.80

Calls 3

compareNodeNameFunction · 0.85
insertElementMethod · 0.80
getBodyFunction · 0.70

Tested by

no test coverage detected