style: format js code

This commit is contained in:
XPoet 2022-10-20 12:26:19 +08:00
parent 51d4d1cc43
commit 1243bcb7c8
2 changed files with 8 additions and 4 deletions

View File

@ -7,9 +7,9 @@ KEEP.initCodeBlockTools = () => {
wrapper.appendChild(this) wrapper.appendChild(this)
} }
const {style: codeCopyStyle} = KEEP.theme_config?.code_copy || {} const { style: codeCopyStyle } = KEEP.theme_config?.code_copy || {}
const {style: codeBlockStyle} = KEEP.theme_config?.code_block || {} const { style: codeBlockStyle } = KEEP.theme_config?.code_block || {}
const {style: codeBlockToolsStyle} = KEEP.theme_config?.code_block?.tools || {} const { style: codeBlockToolsStyle } = KEEP.theme_config?.code_block?.tools || {}
const isMac = (codeCopyStyle || codeBlockStyle || codeBlockToolsStyle || 'default') === 'mac' const isMac = (codeCopyStyle || codeBlockStyle || codeBlockToolsStyle || 'default') === 'mac'
const foldedIconClassName = isMac ? 'fas fa-chevron-left' : 'fas fa-chevron-right' const foldedIconClassName = isMac ? 'fas fa-chevron-left' : 'fas fa-chevron-right'

View File

@ -56,7 +56,11 @@ window.addEventListener('DOMContentLoaded', () => {
KEEP.initLocalSearch() KEEP.initLocalSearch()
} }
if (code_block?.tools?.enable === true || code_block?.enable === true || code_copy?.enable === true) { if (
code_block?.tools?.enable === true ||
code_block?.enable === true ||
code_copy?.enable === true
) {
KEEP.initCodeBlockTools() KEEP.initCodeBlockTools()
} }