File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -267,10 +267,13 @@ export async function initRepository() {
267267
268268 // Commit statuses
269269 $ ( '.commit-statuses-trigger' ) . each ( function ( ) {
270+ const positionRight = $ ( '.repository.file.list' ) . length > 0 || $ ( '.repository.diff' ) . length > 0 ;
271+ const popupPosition = positionRight ? 'right center' : 'left center' ;
270272 $ ( this )
271273 . popup ( {
272274 on : 'click' ,
273- position : ( $ ( '.repository.file.list' ) . length > 0 ? 'right center' : 'left center' ) ,
275+ lastResort : popupPosition , // prevent error message "Popup does not fit within the boundaries of the viewport"
276+ position : popupPosition ,
274277 } ) ;
275278 } ) ;
276279
Original file line number Diff line number Diff line change 11.repository {
2- .commit-statuses .list > .item {
3- line-height : 2 ;
2+ .popup.commit-statuses {
3+ // we had better limit the max size of the popup, and add scroll bars if the content size is too large.
4+ // otherwise some part of the popup will be hidden by viewport boundary
5+ max-height : 45vh ;
6+ max-width : 60vw ;
7+ overflow : auto ;
8+ padding : 0 ;
9+
10+ .list {
11+ padding : .8em ; // to make the scrollbar align to the border, we move the padding from outer `.popup` to this inside `.list`
12+
13+ > .item {
14+ line-height : 2 ;
15+ }
16+ }
417 }
518
619 .repo-header {
You can’t perform that action at this time.
0 commit comments