Add skip-tools utility CSS class

This commit is contained in:
Tetrakern 2024-06-01 19:53:03 +02:00
parent 3597b132a1
commit 29ce069030
4 changed files with 8 additions and 4 deletions

View File

@ -446,6 +446,7 @@ You can also apply additional classes to single words or phrases. Switch to the
| `outside-epub` | Hides a block inside ePUBs. Combine with `inside-epub` to have two variants.
| `inside-epub` | Hides a block outside ePUBs. Combine with `outside-epub` to have two variants.
| `skip-tts` | Blocks with this class will be ignored by the text-to-speech engine. Does not work on spans.
| `skip-tools` | Prevents the paragraph tools from being toggled. Can be used on the paragraph or a span inside.
| `show-if-bookmarks` | Must be used together with `hidden`, which is removed if bookmark cards are present (via shortcode).
| `no-indent` | Suppresses text indentation regardless of settings.
| `list` | Applies list styles if missing.

2
js/chapter.min.js vendored

File diff suppressed because one or more lines are too long

2
js/complete.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -69,8 +69,11 @@ document.addEventListener('click', event => {
*/
function fcn_touchParagraph(e) {
// Do not call paragraphs tools on spoilers or popup menus
if (e.target.classList.contains('spoiler') || e.target.closest('.popup-menu-toggle')) {
// Do not call paragraphs tools on spoilers, popup menus, or escape class
if (
e.target.classList.contains('spoiler') ||
e.target.closest('.popup-menu-toggle, .skip-tools')
) {
return;
}