File tree Expand file tree Collapse file tree 3 files changed +14
-15
lines changed
Expand file tree Collapse file tree 3 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ Template Attributes:
77*/}}
88
99{{if .CommitStatus}}
10- <div class="{{if .IsPopup}}tippy-commit-status{{else}}pr-commit-status{{end}}">
10+ <div class="{{if .IsPopup}}tippy-commit-status{{else}}pr-commit-status{{end}}"{{if not .IsPopup}} data-toggled="true"{{end}} >
1111 <div class="ui attached header top">
1212 {{if eq .CommitStatus.State "pending"}}
1313 {{ctx.Locale.Tr "repo.pulls.status_checking"}}
Original file line number Diff line number Diff line change @@ -3078,19 +3078,20 @@ tbody.commit-list {
30783078 padding : 0 !important ;
30793079 max-height : 231px ;
30803080 overflow-x : hidden;
3081- transition : max-height 0 .2s ;
3082- border-bottom : 0 !important ;
3081+ transition : max-height .2s ;
3082+ border-bottom : none !important ;
30833083}
30843084
3085- .pr-commit-status . hide {
3086- border-bottom : 0 !important ;
3085+ .pr-commit-status [ data-toggled = "false" ] {
3086+ border-bottom : none !important ;
30873087}
30883088
3089- .pr-commit-status .hide .ui .attached .header {
3090- border-bottom : none !important ;
3089+ .pr-commit-status [data-toggled = "false" ] .ui .attached .header {
3090+ transition-delay : .2s ;
3091+ border-bottom-width : 0 !important ;
30913092}
30923093
3093- .pr-commit-status . hide .commit-status-list {
3094+ .pr-commit-status [ data-toggled = "false" ] .commit-status-list {
30943095 max-height : 0 ;
30953096}
30963097
Original file line number Diff line number Diff line change 11export function initRepoPullRequestCommitStatus ( ) {
22 const btn = document . querySelector ( '.hide-all-checks' ) ;
3- const prCommitStatus = document . querySelector ( '.pr-commit-status' ) ;
43 if ( ! btn ) return ;
4+
55 btn . addEventListener ( 'click' , ( ) => {
6- if ( prCommitStatus . classList . contains ( 'hide' ) ) {
7- btn . textContent = btn . getAttribute ( 'data-hide-all' ) ;
8- } else {
9- btn . textContent = btn . getAttribute ( 'data-show-all' ) ;
10- }
11- prCommitStatus . classList . toggle ( 'hide' ) ;
6+ const prCommitStatus = document . querySelector ( '.pr-commit-status' ) ;
7+ const toggled = prCommitStatus . getAttribute ( 'data-toggled' ) === 'true' ;
8+ btn . textContent = btn . getAttribute ( toggled ? 'data-hide-all' : 'data-show-all' ) ;
9+ prCommitStatus . setAttribute ( 'data-toggled' , String ( ! toggled ) ) ;
1210 } ) ;
1311}
You can’t perform that action at this time.
0 commit comments