fixed issues with the random button and hotkeys #2

Merged
eins merged 3 commits from eins/f0bm:f0bm into f0bm 2026-01-23 14:53:20 +00:00
6 changed files with 105 additions and 90 deletions
Showing only changes of commit 45f9345e9c - Show all commits

View File

@@ -140,7 +140,7 @@ window.requestAnimFrame = (function () {
html = rawText;
}
let container = document.querySelector('.container');
let container = document.querySelector('#main .container');
if (!container && document.querySelector('.index-container')) {
// Transition from Index to Item View
@@ -148,13 +148,19 @@ window.requestAnimFrame = (function () {
main.innerHTML = '<div class="container"></div>';
container = main.querySelector('.container');
} else if (container) {
// Already in Item View, clear usage
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();
// Check if we are on Tags Overview logic (which reuses .container)
const tagsOverview = container.querySelector('.tags');
if (tagsOverview) {
container.innerHTML = '';
} else {
// Already in Item View, clear usage
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);