Refactor GUI rendering and align RTA axis
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
let loadPromise = null;
|
||||
|
||||
export function setupLazyChangelog(details, content) {
|
||||
if (!details || !content || details.dataset.bound === '1') return;
|
||||
details.dataset.bound = '1';
|
||||
|
||||
const load = async () => {
|
||||
if (content.dataset.loaded === '1') return;
|
||||
if (!loadPromise) {
|
||||
loadPromise = fetch('./changelog.html', { cache: 'no-cache' })
|
||||
.then((response) => {
|
||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||
return response.text();
|
||||
});
|
||||
}
|
||||
try {
|
||||
content.innerHTML = await loadPromise;
|
||||
content.dataset.loaded = '1';
|
||||
} catch (error) {
|
||||
loadPromise = null;
|
||||
content.textContent = 'Versionsverlauf konnte nicht geladen werden.';
|
||||
console.warn('Changelog load error:', error);
|
||||
}
|
||||
};
|
||||
|
||||
details.addEventListener('toggle', () => {
|
||||
if (details.open) void load();
|
||||
});
|
||||
if (details.open) void load();
|
||||
}
|
||||
Reference in New Issue
Block a user