Code Format

pull/4649/head
GitHub Actions Bot 2023-10-17 22:02:28 +00:00
parent 9e13aaf342
commit 610b9696ba
1 changed files with 2 additions and 2 deletions

View File

@ -161,13 +161,13 @@ function switchTheme(currentTheme, newTheme, linkElementId, callback) {
const linkElement = document.getElementById(linkElementId);
const cloneLinkElement = linkElement.cloneNode(true);
const newThemeUrl = linkElement.getAttribute('href').replace(currentTheme, newTheme);
cloneLinkElement.setAttribute('id', linkElementId + '-clone');
cloneLinkElement.setAttribute('href', newThemeUrl);
cloneLinkElement.addEventListener('load', () => {
linkElement.remove();
cloneLinkElement.setAttribute('id', linkElementId);
if (callback) {
callback();
}