Skip to content

Commit

Permalink
[JENKINS-74068] Extract inline JavaScript from `BuildMonitorView/conf…
Browse files Browse the repository at this point in the history
…igure-entries.jelly` (#1030)
  • Loading branch information
yaroslavafenkin authored Nov 6, 2024
1 parent 18a5ca6 commit f827941
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:st="jelly:stapler">

<!-- BEGIN cut'n'paste from https://github.com/jenkinsci/jenkins/blob/jenkins-1.532/core/src/main/resources/hudson/model/ListView/configure-entries.jelly -->

Expand Down Expand Up @@ -129,17 +129,6 @@

</f:section>

<script>
(function() {
Behaviour.specify("#recurse", 'ListView', 0, function(e) {
var nestedElements = document.querySelectorAll('SPAN.nested')
e.onclick = function() {
nestedElements.forEach(function(el) {
el.style.display = e.checked ? '' : 'none';
});
}
});
}());
</script>
<st:adjunct includes="com.smartcodeltd.jenkinsci.plugins.buildmonitor.BuildMonitorView.show-nested-jobs"/>

</j:jelly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Behaviour.specify("#recurse", "ListView", 0, function(e) {
var nestedElements = document.querySelectorAll("SPAN.nested")
e.onclick = function() {
nestedElements.forEach(function(el) {
el.style.display = e.checked ? "" : "none";
});
}
});

0 comments on commit f827941

Please sign in to comment.