Skip to content

Commit

Permalink
Merge pull request #181 from yaroslavafenkin/JENKINS-74012
Browse files Browse the repository at this point in the history
[JENKINS-74012] Extract JavaScript block from `SourceCodeViewModel/index.jelly`
  • Loading branch information
uhafner authored Nov 11, 2024
2 parents 28fc37b + 6320423 commit fabff45
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,7 @@
<j:out value="${it.sourceCode}"/>

<st:adjunct includes="io.jenkins.plugins.jquery3"/>

<script type="text/javascript">
/* global jQuery3 */
/**
* Scroll to the warning.
*/
jQuery3.fn.scrollView = function () {
return this.each(function () {
jQuery3('html, body').animate({
scrollTop: jQuery3(this).offset().top - (jQuery3(window).height() / 2)
}, 1000);
});
};
jQuery3(document).ready(function () {
jQuery3('.highlight').scrollView();
});
jQuery3('.analysis-collapse-button').click(function () {
jQuery3('#analysis-description').collapse('toggle');
jQuery3('.analysis-collapse-button').toggleClass('open');
});
</script>
<st:adjunct includes="io.jenkins.plugins.prism.SourceCodeViewModel.scroll-view"/>

</bs:page>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* global jQuery3 */
/**
* Scroll to the warning.
*/
jQuery3.fn.scrollView = function () {
return this.each(function () {
jQuery3('html, body').animate({
scrollTop: jQuery3(this).offset().top - (jQuery3(window).height() / 2)
}, 1000);
});
};
jQuery3(document).ready(function () {
jQuery3('.highlight').scrollView();
});
jQuery3('.analysis-collapse-button').click(function () {
jQuery3('#analysis-description').collapse('toggle');
jQuery3('.analysis-collapse-button').toggleClass('open');
});

0 comments on commit fabff45

Please sign in to comment.