Skip to content

Commit

Permalink
Adding onClick dynamically
Browse files Browse the repository at this point in the history
moving adjunct after creation of elements
  • Loading branch information
judovana committed Oct 17, 2024
1 parent 6525070 commit 660b2b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout">
<st:adjunct includes="hudson.plugins.nested_view.NestedViewsSearch.searchscripts"/>
<j:set var="q" value="${request.getParameter('q')}"/>
<j:new var="h" className="hudson.Functions"/>
<!-- needed for printing title. -->
<l:layout title="${%Search for} '${q}'">
<l:side-panel>
<h2><l:icon class="icon-help icon-sm" /> Search help</h2>
<a onclick="nvwp_showHide_button_2_1_show()"
style="font-size: smaller; display: inline" href="#" id="button_expand_2_1">Search History (expand)</a>
<a onclick="nvwp_showHide_button_2_1_hide()"
style="font-size: smaller; display: none" href="#" id="button_collapse_2_1">Search History (collapse)</a>
<a style="font-size: smaller; display: inline" href="#" id="button_expand_2_1">Search History (expand)</a>
<a style="font-size: smaller; display: none" href="#" id="button_collapse_2_1">Search History (collapse)</a>
<st:adjunct includes="hudson.plugins.nested_view.NestedViewsSearch.searchscripts"/>
<div style="display: none" id="details_2_1">
<ol>
<j:forEach var="hist" items="${it.getHistory()}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,13 @@ function nvwp_showHide_button_2_1_hide() {
return false;
}

const exEl = document.getElementById("button_expand_2_1");
exEl.addEventListener("click", nvwp_showHide_button_2_1_show);

const colEl = document.getElementById("button_collapse_2_1");
colEl.addEventListener("click", nvwp_showHide_button_2_1_hide);



// ]]>

0 comments on commit 660b2b2

Please sign in to comment.