Compare commits
2 Commits
6799ec1567
...
45f9345e9c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45f9345e9c | ||
|
|
c74e5a7402 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,3 +8,4 @@ deleted/b
|
|||||||
deleted/ca
|
deleted/ca
|
||||||
deleted/t
|
deleted/t
|
||||||
tmp/*
|
tmp/*
|
||||||
|
tools
|
||||||
@@ -140,7 +140,7 @@ window.requestAnimFrame = (function () {
|
|||||||
html = rawText;
|
html = rawText;
|
||||||
}
|
}
|
||||||
|
|
||||||
let container = document.querySelector('.container');
|
let container = document.querySelector('#main .container');
|
||||||
|
|
||||||
if (!container && document.querySelector('.index-container')) {
|
if (!container && document.querySelector('.index-container')) {
|
||||||
// Transition from Index to Item View
|
// Transition from Index to Item View
|
||||||
@@ -148,13 +148,19 @@ window.requestAnimFrame = (function () {
|
|||||||
main.innerHTML = '<div class="container"></div>';
|
main.innerHTML = '<div class="container"></div>';
|
||||||
container = main.querySelector('.container');
|
container = main.querySelector('.container');
|
||||||
} else if (container) {
|
} else if (container) {
|
||||||
// Already in Item View, clear usage
|
// Check if we are on Tags Overview logic (which reuses .container)
|
||||||
const oldContent = container.querySelector('.content');
|
const tagsOverview = container.querySelector('.tags');
|
||||||
const oldMetadata = container.querySelector('.metadata');
|
if (tagsOverview) {
|
||||||
const oldHeader = container.querySelector('._204863');
|
container.innerHTML = '';
|
||||||
if (oldHeader) oldHeader.remove();
|
} else {
|
||||||
if (oldContent) oldContent.remove();
|
// Already in Item View, clear usage
|
||||||
if (oldMetadata) oldMetadata.remove();
|
const oldContent = container.querySelector('.content');
|
||||||
|
const oldMetadata = container.querySelector('.metadata');
|
||||||
|
const oldHeader = container.querySelector('._204863');
|
||||||
|
if (oldHeader) oldHeader.remove();
|
||||||
|
if (oldContent) oldContent.remove();
|
||||||
|
if (oldMetadata) oldMetadata.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
container.insertAdjacentHTML('beforeend', html);
|
container.insertAdjacentHTML('beforeend', html);
|
||||||
@@ -187,13 +193,12 @@ window.requestAnimFrame = (function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const changePage = (e, pbwork = true) => {
|
const changePage = (e, pbwork = true) => {
|
||||||
if (e.tagName === 'A') {
|
if (pbwork) {
|
||||||
e.preventDefault();
|
const nav = document.querySelector("nav.navbar");
|
||||||
loadItemAjax(e.href);
|
if (nav) nav.classList.add("pbwork");
|
||||||
} else {
|
|
||||||
pbwork && document.querySelector("nav.navbar").classList.add("pbwork");
|
|
||||||
!tt && (tt = setTimeout(() => e.click(), stimeout));
|
|
||||||
}
|
}
|
||||||
|
// Trigger native click for navigation
|
||||||
|
e.click();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Intercept clicks
|
// Intercept clicks
|
||||||
|
|||||||
Reference in New Issue
Block a user