From ec4cc0a276dad75bc58d818bfc35cbd04595bcc2 Mon Sep 17 00:00:00 2001 From: Yaroslav Afenkin <91559310+yaroslavafenkin@users.noreply.github.com> Date: Fri, 1 Nov 2024 19:45:02 +0200 Subject: [PATCH] [JENKINS-74030] Extract inline script from `ChoiceParameter/index.jelly` --- .../org/biouno/unochoice/ChoiceParameter/index.jelly | 9 ++++----- .../unochoice/ChoiceParameter/render-choice-parameter.js | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 src/main/resources/org/biouno/unochoice/ChoiceParameter/render-choice-parameter.js diff --git a/src/main/resources/org/biouno/unochoice/ChoiceParameter/index.jelly b/src/main/resources/org/biouno/unochoice/ChoiceParameter/index.jelly index 3b54641a..41c5de35 100644 --- a/src/main/resources/org/biouno/unochoice/ChoiceParameter/index.jelly +++ b/src/main/resources/org/biouno/unochoice/ChoiceParameter/index.jelly @@ -2,9 +2,8 @@ ${it.parameters.clear()} - + + + + diff --git a/src/main/resources/org/biouno/unochoice/ChoiceParameter/render-choice-parameter.js b/src/main/resources/org/biouno/unochoice/ChoiceParameter/render-choice-parameter.js new file mode 100644 index 00000000..323d6b97 --- /dev/null +++ b/src/main/resources/org/biouno/unochoice/ChoiceParameter/render-choice-parameter.js @@ -0,0 +1,6 @@ +window.addEventListener("DOMContentLoaded", () => { + document.querySelectorAll(".choice-parameter-data-holder").forEach((dataHolder) => { + const { paramName, filterLength } = dataHolder.dataset; + UnoChoice.renderChoiceParameter(paramName, filterLength); + }); +});