From 1243bcb7c819827fa7f5ab5d978e2d9739494683 Mon Sep 17 00:00:00 2001 From: XPoet Date: Thu, 20 Oct 2022 12:26:19 +0800 Subject: [PATCH] style: format js code --- source/js/code-block.js | 6 +++--- source/js/main.js | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source/js/code-block.js b/source/js/code-block.js index 43ab7ba..a8fad81 100644 --- a/source/js/code-block.js +++ b/source/js/code-block.js @@ -7,9 +7,9 @@ KEEP.initCodeBlockTools = () => { wrapper.appendChild(this) } - const {style: codeCopyStyle} = KEEP.theme_config?.code_copy || {} - const {style: codeBlockStyle} = KEEP.theme_config?.code_block || {} - const {style: codeBlockToolsStyle} = KEEP.theme_config?.code_block?.tools || {} + const { style: codeCopyStyle } = KEEP.theme_config?.code_copy || {} + const { style: codeBlockStyle } = KEEP.theme_config?.code_block || {} + const { style: codeBlockToolsStyle } = KEEP.theme_config?.code_block?.tools || {} const isMac = (codeCopyStyle || codeBlockStyle || codeBlockToolsStyle || 'default') === 'mac' const foldedIconClassName = isMac ? 'fas fa-chevron-left' : 'fas fa-chevron-right' diff --git a/source/js/main.js b/source/js/main.js index cf271e5..155332a 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -56,7 +56,11 @@ window.addEventListener('DOMContentLoaded', () => { 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() }