-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #181 from yaroslavafenkin/JENKINS-74012
[JENKINS-74012] Extract JavaScript block from `SourceCodeViewModel/index.jelly`
- Loading branch information
Showing
2 changed files
with
19 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/resources/io/jenkins/plugins/prism/SourceCodeViewModel/scroll-view.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); |