From 0f6cba912453282edf396cc2bc321aa0feb18762 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Mon, 27 May 2024 20:43:03 +1000 Subject: [PATCH] Fix cascade for clickable actions when followed by text. --- project-docs/release-notes/version-2.7.1.md | 6 ++++++ .../opt/renderer/src/frontend/scripts/educates.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/project-docs/release-notes/version-2.7.1.md b/project-docs/release-notes/version-2.7.1.md index 3034b6db..b7ad2407 100644 --- a/project-docs/release-notes/version-2.7.1.md +++ b/project-docs/release-notes/version-2.7.1.md @@ -66,3 +66,9 @@ Bugs Fixed workshop dashboard would still be accessible, but request objects would be missing. Timeout for workshop session registration has been increased to 90 seconds. + +* If text followed a clickable action and the `cascade` option was used, the + subsequent clickable action would not be automatically triggered. It would + work okay if the next clickable action immediately followed the first. This + was broken when the cascade mechanim was extended to all clickable actions and + not just examiner clickable actions. diff --git a/workshop-images/base-environment/opt/renderer/src/frontend/scripts/educates.ts b/workshop-images/base-environment/opt/renderer/src/frontend/scripts/educates.ts index 60a71e49..5ff1b97b 100644 --- a/workshop-images/base-environment/opt/renderer/src/frontend/scripts/educates.ts +++ b/workshop-images/base-environment/opt/renderer/src/frontend/scripts/educates.ts @@ -829,10 +829,10 @@ export function register_action(options: any) { setTimeout(() => { if (generator.startsWith("Educates (asciidoc)")) { let root_element = parent_element.parent().parent() - root_element.next(`*[data-action-name]`).children("div.content").children("div.magic-code-block-title").trigger("click") + root_element.nextAll(`*[data-action-name]`).first().children("div.content").children("div.magic-code-block-title").trigger("click") } else { - parent_element.next(`*[data-action-name]`).trigger("click") + parent_element.nextAll(`*[data-action-name]`).first().trigger("click") } }, action_args.pause || pause) }