fix: multiple registration events lead to incorrect click events (#305)
This commit is contained in:
parent
46415dec88
commit
c8142d0ac5
1 changed files with 6 additions and 6 deletions
|
|
@ -74,29 +74,29 @@ function switchTheme() {
|
||||||
function loadButtonScript() {
|
function loadButtonScript() {
|
||||||
let switchBtn = document.getElementById("scheme-switch");
|
let switchBtn = document.getElementById("scheme-switch");
|
||||||
if (switchBtn) {
|
if (switchBtn) {
|
||||||
switchBtn.addEventListener("click", function () {
|
switchBtn.onclick = function () {
|
||||||
switchTheme()
|
switchTheme()
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let settingBtn = document.getElementById("display-settings-switch");
|
let settingBtn = document.getElementById("display-settings-switch");
|
||||||
if (settingBtn) {
|
if (settingBtn) {
|
||||||
settingBtn.addEventListener("click", function () {
|
settingBtn.onclick = function () {
|
||||||
let settingPanel = document.getElementById("display-setting");
|
let settingPanel = document.getElementById("display-setting");
|
||||||
if (settingPanel) {
|
if (settingPanel) {
|
||||||
settingPanel.classList.toggle("float-panel-closed");
|
settingPanel.classList.toggle("float-panel-closed");
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let menuBtn = document.getElementById("nav-menu-switch");
|
let menuBtn = document.getElementById("nav-menu-switch");
|
||||||
if (menuBtn) {
|
if (menuBtn) {
|
||||||
menuBtn.addEventListener("click", function () {
|
menuBtn.onclick = function () {
|
||||||
let menuPanel = document.getElementById("nav-menu-panel");
|
let menuPanel = document.getElementById("nav-menu-panel");
|
||||||
if (menuPanel) {
|
if (menuPanel) {
|
||||||
menuPanel.classList.toggle("float-panel-closed");
|
menuPanel.classList.toggle("float-panel-closed");
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue