diff --git a/include/style/codeblock.styl b/include/style/codeblock.styl index 0cae04f..c55d045 100644 --- a/include/style/codeblock.styl +++ b/include/style/codeblock.styl @@ -13,7 +13,7 @@ figure.highlight &.folded .highlight-body height: 0 - + .copy opacity: .7 @@ -90,6 +90,10 @@ figure.highlight min-width: inherit border-radius: inherit +figure.highlight.foldable + div.level-left + cursor: pointer // clicking the codeblock filename can toggle folding + /* --------------------------------- * Fix Gist Snippet * --------------------------------- */ diff --git a/package.json b/package.json index 177249f..2905905 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-icarus", - "version": "5.0.0-rc.1", + "version": "5.0.1", "author": "ppoffice ", "license": "MIT", "description": "A simple, delicate, and modern theme for Hexo", @@ -30,7 +30,7 @@ "bulma-stylus": "0.8.0", "deepmerge": "^4.2.2", "hexo": "^6.0.0", - "hexo-component-inferno": "^1.1.0", + "hexo-component-inferno": "^1.2.0", "hexo-log": "^3.0.0", "hexo-pagination": "^2.0.0", "hexo-renderer-inferno": "^0.1.3", diff --git a/source/js/main.js b/source/js/main.js index 7f46128..76891f5 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -98,6 +98,8 @@ if (fold) { $('figure.highlight').each(function() { + $(this).addClass('foldable'); // add 'foldable' class as long as fold is enabled + if ($(this).find('figcaption').find('span').length > 0) { const span = $(this).find('figcaption').find('span'); if (span[0].innerText.indexOf('>folded') > -1) { @@ -111,7 +113,7 @@ toggleFold(this, fold === 'folded'); }); - $('figure.highlight figcaption .fold').click(function() { + $('figure.highlight figcaption .level-left').click(function() { const $code = $(this).closest('figure.highlight'); toggleFold($code.eq(0), !$code.hasClass('folded')); });