diff --git a/src/main/resources/io/jenkins/plugins/prism/SourceCodeViewModel/index.jelly b/src/main/resources/io/jenkins/plugins/prism/SourceCodeViewModel/index.jelly index 1a6c026..ecbd28c 100644 --- a/src/main/resources/io/jenkins/plugins/prism/SourceCodeViewModel/index.jelly +++ b/src/main/resources/io/jenkins/plugins/prism/SourceCodeViewModel/index.jelly @@ -12,27 +12,7 @@ - - + diff --git a/src/main/resources/io/jenkins/plugins/prism/SourceCodeViewModel/scroll-view.js b/src/main/resources/io/jenkins/plugins/prism/SourceCodeViewModel/scroll-view.js new file mode 100644 index 0000000..a471a7f --- /dev/null +++ b/src/main/resources/io/jenkins/plugins/prism/SourceCodeViewModel/scroll-view.js @@ -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'); +});