From 9f25b62e8c22ec03f224377d836e2a526cda68c2 Mon Sep 17 00:00:00 2001 From: Yuxin Wu Date: Sat, 7 May 2022 14:07:26 -0700 Subject: [PATCH 1/3] make codeblock folding has a larger clickable area --- include/style/codeblock.styl | 10 +++++++++- source/js/main.js | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/style/codeblock.styl b/include/style/codeblock.styl index 0cae04f..f21dd68 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,14 @@ figure.highlight min-width: inherit border-radius: inherit +figure.highlight.folded + figcaption + cursor: pointer + +figure.highlight.unfolded + figcaption + cursor: pointer + /* --------------------------------- * Fix Gist Snippet * --------------------------------- */ diff --git a/source/js/main.js b/source/js/main.js index 7f46128..ab50082 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -111,7 +111,7 @@ toggleFold(this, fold === 'folded'); }); - $('figure.highlight figcaption .fold').click(function() { + $('figure.highlight figcaption').click(function() { const $code = $(this).closest('figure.highlight'); toggleFold($code.eq(0), !$code.hasClass('folded')); }); From ca5157973cef36295ac114576ddfb21b89de88c9 Mon Sep 17 00:00:00 2001 From: Yuxin Wu Date: Sat, 7 May 2022 15:35:10 -0700 Subject: [PATCH 2/3] Update codeblock.styl --- include/style/codeblock.styl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/style/codeblock.styl b/include/style/codeblock.styl index f21dd68..c55d045 100644 --- a/include/style/codeblock.styl +++ b/include/style/codeblock.styl @@ -90,13 +90,9 @@ figure.highlight min-width: inherit border-radius: inherit -figure.highlight.folded - figcaption - cursor: pointer - -figure.highlight.unfolded - figcaption - cursor: pointer +figure.highlight.foldable + div.level-left + cursor: pointer // clicking the codeblock filename can toggle folding /* --------------------------------- * Fix Gist Snippet From 8300367f09b3c474135a4ba5ed823dd5be87d3fc Mon Sep 17 00:00:00 2001 From: Yuxin Wu Date: Sat, 7 May 2022 15:35:37 -0700 Subject: [PATCH 3/3] Update main.js --- source/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/js/main.js b/source/js/main.js index ab50082..6b668fa 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -111,7 +111,7 @@ toggleFold(this, fold === 'folded'); }); - $('figure.highlight figcaption').click(function() { + $('figure.highlight figcaption .level-left').click(function() { const $code = $(this).closest('figure.highlight'); toggleFold($code.eq(0), !$code.hasClass('folded')); });