Merge pull request #1072 from ppwwyyxx/master

Make codeblock fold/unfold use a larger clickable area
pull/1084/head
Ruipeng Zhang 2022-05-07 20:04:46 -04:00 committed by GitHub
commit 63cef9061d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -13,7 +13,7 @@ figure.highlight
&.folded &.folded
.highlight-body .highlight-body
height: 0 height: 0
.copy .copy
opacity: .7 opacity: .7
@ -90,6 +90,10 @@ figure.highlight
min-width: inherit min-width: inherit
border-radius: inherit border-radius: inherit
figure.highlight.foldable
div.level-left
cursor: pointer // clicking the codeblock filename can toggle folding
/* --------------------------------- /* ---------------------------------
* Fix Gist Snippet * Fix Gist Snippet
* --------------------------------- */ * --------------------------------- */

View File

@ -113,7 +113,7 @@
toggleFold(this, fold === 'folded'); toggleFold(this, fold === 'folded');
}); });
$('figure.highlight figcaption .fold').click(function() { $('figure.highlight figcaption .level-left').click(function() {
const $code = $(this).closest('figure.highlight'); const $code = $(this).closest('figure.highlight');
toggleFold($code.eq(0), !$code.hasClass('folded')); toggleFold($code.eq(0), !$code.hasClass('folded'));
}); });