fix: report an error when 'side_tools' config is false

This commit is contained in:
git710 2020-11-08 13:19:36 +08:00
parent 13e1691f90
commit 11c649e97b
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ window.addEventListener('DOMContentLoaded', () => {
}, },
initModeToggleButton() { initModeToggleButton() {
this.modeToggleButton_dom.addEventListener('click', () => { this.modeToggleButton_dom && this.modeToggleButton_dom.addEventListener('click', () => {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
this.setItemUtil('light-mode', 'dark'); this.setItemUtil('light-mode', 'dark');
} else { } else {

View File

@ -72,7 +72,7 @@ ILS.utils = {
this.toolsMenuButton_dom = document.querySelector('.tools-button'); this.toolsMenuButton_dom = document.querySelector('.tools-button');
this.toolsWrapperList_dom = document.querySelectorAll('.tools-wrapper li'); this.toolsWrapperList_dom = document.querySelectorAll('.tools-wrapper li');
this.toolsMenuButton_dom.addEventListener('click', e => { this.toolsMenuButton_dom && this.toolsMenuButton_dom.addEventListener('click', e => {
isOpen = !isOpen; isOpen = !isOpen;
const toolsMenuButtonIcon = this.toolsMenuButton_dom.querySelector('i'); const toolsMenuButtonIcon = this.toolsMenuButton_dom.querySelector('i');