mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
🐛 fix: 修復highlight_shrink設為false時,導致script報錯的bug
🐛 fix: 修復highlight_shrink設為true時,按鈕點擊無反應,沒有打開代碼框的bug 🐛 fix: 修復自動切換darkmode時,切換按鈕icon沒有變更的bug
This commit is contained in:
@@ -112,7 +112,7 @@ script.
|
||||
baiduPush: !{baiduPush},
|
||||
highlightCopy: !{highlightCopy},
|
||||
highlightLang: !{highlightLang},
|
||||
highlightShrink: !{highlightShrink},
|
||||
highlightShrink: '!{highlightShrink}',
|
||||
isFontAwesomeV5: !{isFontAwesomeV5}
|
||||
|
||||
}
|
||||
|
||||
@@ -271,16 +271,16 @@ $(function () {
|
||||
* 代碼收縮
|
||||
*/
|
||||
const $highlightTools = $('.highlight-tools')
|
||||
if (isHighlightShrink === true) {
|
||||
if (isHighlightShrink === 'true') {
|
||||
$highlightTools.append('<i class="fa fa-angle-down code-expand code-closed" aria-hidden="true"></i>')
|
||||
} else if (isHighlightShrink === false) {
|
||||
} else if (isHighlightShrink === 'false') {
|
||||
$highlightTools.append('<i class="fa fa-angle-down code-expand" aria-hidden="true"></i>')
|
||||
}
|
||||
|
||||
$(document).on('click', '.highlight-tools >.code-expand', function () {
|
||||
var $table = $(this).parent().next()
|
||||
if ($(this).hasClass('code-closed')) {
|
||||
$table.css('display', '')
|
||||
$table.css('display', 'block')
|
||||
$(this).removeClass('code-closed')
|
||||
} else {
|
||||
$table.css('display', 'none')
|
||||
@@ -668,8 +668,7 @@ $(function () {
|
||||
var isFontAwesomeV5 = GLOBAL_CONFIG.isFontAwesomeV5
|
||||
var $darkModeButtom = $('#darkmode')
|
||||
if (typeof autoChangeMode !== 'undefined') {
|
||||
if (Cookies.get('theme') === 'dark') changeLightIcon()
|
||||
else changeDarkIcon()
|
||||
document.documentElement.getAttribute('data-theme') === 'dark' ? changeLightIcon() : changeDarkIcon()
|
||||
}
|
||||
|
||||
function changeLightIcon () {
|
||||
|
||||
Reference in New Issue
Block a user