This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit 2f58e69
1 parent 7eaf192 commit 2f58e69 Copy full SHA for 2f58e69
File tree 9 files changed +35
-52
lines changed
9 files changed +35
-52
lines changed Original file line number Diff line number Diff line change 24
24
{{svg "octicon-diff" 16 "gt-mr-2"}}{{.locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
25
25
</div>
26
26
</div>
27
- <div class="diff-detail-actions gt-df gt-ac">
27
+ <div class="diff-detail-actions gt-df gt-ac gt-w-100 ">
28
28
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
29
29
<progress id="viewed-files-summary" class="gt-mr-2" value="{{.Diff.NumViewedFiles}}" max="{{.Diff.NumFiles}}"></progress>
30
- <label for="viewed-files-summary" id="viewed-files-summary-label" class="gt-mr-3" data-text-changed-template="{{.locale.Tr "repo.pulls.viewed_files_label"}}">
30
+ <label for="viewed-files-summary" id="viewed-files-summary-label" class="gt-mr-3 gt-f1 " data-text-changed-template="{{.locale.Tr "repo.pulls.viewed_files_label"}}">
31
31
{{.locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}}
32
32
</label>
33
33
{{end}}
Original file line number Diff line number Diff line change 1
- <div class="ui top right pointing dropdown custom" id="review-box">
2
- <div class="ui tiny green button btn-review gt-ml-2 gt-mr-0">
1
+ <div id="review-box">
2
+ <button class="ui tiny green button gt-ml-2 gt-mr-0 js-btn-review ">
3
3
{{.locale.Tr "repo.diff.review"}}
4
4
<span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span>
5
5
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
6
- </div >
7
- <div class="menu review-box">
8
- <div class="ui clearing segment">
6
+ </button >
7
+ <div class="review-box-panel gt-hidden ">
8
+ <div class="ui segment">
9
9
<form class="ui form" action="{{.Link}}/reviews/submit" method="post">
10
10
{{.CsrfTokenHtml}}
11
11
<input type="hidden" name="commit_id" value="{{.AfterCommitID}}"/>
Original file line number Diff line number Diff line change 77
77
<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a>
78
78
{{end}}
79
79
{{if or .CanAddFile .CanUploadFile}}
80
- <button class="ui basic small compact dropdown jump icon button gt-mr-2"{{if not .Repository.CanEnableEditor}} disabled{{end}}>
80
+ <button class="ui basic compact dropdown jump icon button gt-mr-2"{{if not .Repository.CanEnableEditor}} disabled{{end}}>
81
81
<span class="text">{{.locale.Tr "repo.editor.add_file"}}</span>
82
82
<div class="menu">
83
83
{{if .CanAddFile}}
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ export function initGlobalEnterQuickSubmit() {
60
60
export function initGlobalButtonClickOnEnter ( ) {
61
61
$ ( document ) . on ( 'keypress' , '.ui.button' , ( e ) => {
62
62
if ( e . keyCode === 13 || e . keyCode === 32 ) { // enter key or space bar
63
+ if ( e . target . nodeName === 'BUTTON' ) return ; // button already handles space&enter correctly
63
64
$ ( e . target ) . trigger ( 'click' ) ;
64
65
e . preventDefault ( ) ;
65
66
}
Original file line number Diff line number Diff line change @@ -470,7 +470,7 @@ export function initRepoPullRequestReview() {
470
470
assignMenuAttributes ( form . find ( '.menu' ) ) ;
471
471
} ) ;
472
472
473
- const $reviewBox = $ ( '.review-box' ) ;
473
+ const $reviewBox = $ ( '.review-box-panel ' ) ;
474
474
if ( $reviewBox . length === 1 ) {
475
475
( async ( ) => {
476
476
// the editor's height is too large in some cases, and the panel cannot be scrolled with page now because there is `.repository .diff-detail-box.sticky { position: sticky; }`
@@ -487,12 +487,12 @@ export function initRepoPullRequestReview() {
487
487
return ;
488
488
}
489
489
490
- $ ( '.btn-review' ) . on ( 'click' , function ( e ) {
490
+ $ ( '.js- btn-review' ) . on ( 'click' , function ( e ) {
491
491
e . preventDefault ( ) ;
492
- $ ( this ) . closest ( '.dropdown' ) . find ( '.menu' ) . toggle ( 'visible' ) ; // eslint-disable-line
493
- } ) . closest ( '.dropdown' ) . find ( '.close' ) . on ( 'click' , function ( e ) {
492
+ toggleElem ( $ ( this ) . parent ( ) . find ( '.review-box-panel' ) ) ;
493
+ } ) . parent ( ) . find ( '.review-box-panel .close' ) . on ( 'click' , function ( e ) {
494
494
e . preventDefault ( ) ;
495
- $ ( this ) . closest ( '.menu' ) . toggle ( 'visible' ) ; // eslint-disable-line
495
+ hideElem ( $ ( this ) . closest ( '.review-box-panel' ) ) ;
496
496
} ) ;
497
497
498
498
$ ( document ) . on ( 'click' , 'a.add-code-comment' , async function ( e ) {
Original file line number Diff line number Diff line change @@ -2477,24 +2477,13 @@ table th[data-sortt-desc] {
2477
2477
}
2478
2478
}
2479
2479
2480
- /* fix up SVG dropdown triangles because fomantic thinks they are icon fonts */
2481
- /* see https://github.com/go-gitea/gitea/issues/14014 */
2482
- .ui.dropdown > .dropdown.icon ,
2483
- .btn-review > .dropdown.icon {
2484
- height : auto !important ;
2485
- margin-left : .5rem !important ;
2486
- margin-top : -1px !important ;
2487
- margin-bottom : -1px !important ;
2488
- margin-right : -.5rem !important ;
2480
+ .ui.dropdown .svg.dropdown.icon ,
2481
+ .svg.dropdown.icon {
2482
+ margin-top : 0 !important ; // reset the "ui.selection.dropdown > .dropdown.icon {margin-top}", for the Issue Dependencies dropdown
2483
+ margin-right : -.5rem !important ; // fix up SVG dropdown triangles because Fomantic thinks they are icon fonts
2484
+ height : auto ; // reset the ".ui.dropdown > .dropdown.icon {height}", otherwise the icon would be too small
2489
2485
}
2490
- .ui.button.dropdown > .dropdown.icon ,
2491
- .btn-review > .dropdown.icon {
2492
- float : right !important ;
2493
2486
2494
- @media (max-width : 480px ) {
2495
- display : none ;
2496
- }
2497
- }
2498
2487
.ui.selection.dropdown > .search.icon ,
2499
2488
.ui.selection.dropdown > .delete.icon ,
2500
2489
.ui.selection.dropdown > .dropdown.icon {
Original file line number Diff line number Diff line change 13
13
}
14
14
15
15
.editor-toolbar {
16
- opacity : 1 !important ;
16
+ max-width : calc ( 100 vw - 80 px ) ;
17
17
border-color : var (--color-secondary );
18
18
}
19
19
Original file line number Diff line number Diff line change 2888
2888
margin-top : 10px ;
2889
2889
}
2890
2890
2891
- .repo-button-row .dropdown > .dropdown.icon {
2892
- margin-left : .25rem !important ;
2893
- margin-right : 0 !important ;
2894
- }
2895
-
2896
2891
.wiki .repo-button-row {
2897
2892
margin-bottom : 0 ;
2898
2893
}
Original file line number Diff line number Diff line change @@ -220,47 +220,45 @@ a.blob-excerpt:hover {
220
220
221
221
// See the comment of createCommentEasyMDE() for the review editor
222
222
// EasyMDE's options can not handle minHeight & maxHeight together correctly, we have to set minHeight in JS code
223
- # review-box .CodeMirror-scroll {
223
+ . review-box-panel .CodeMirror-scroll {
224
224
min-height : 80px ;
225
225
max-height : calc (100vh - 360px );
226
226
}
227
227
228
228
@media @mediaSm {
229
- #review-box > .menu {
230
- > .ui.segment {
231
- width : 94vw ;
232
- }
233
-
234
- .editor-toolbar {
235
- overflow-x : auto ;
236
- }
237
- }
238
-
239
- #review-box .CodeMirror-scroll {
229
+ .review-box-panel .CodeMirror-scroll {
240
230
max-width : calc (100vw - 70px );
241
231
}
242
232
}
243
233
244
234
@media @mediaMd {
245
- # review-box .CodeMirror-scroll {
235
+ . review-box-panel .CodeMirror-scroll {
246
236
max-width : 700px ;
247
237
}
248
238
}
249
239
250
240
@media @mediaLg {
251
- # review-box .CodeMirror-scroll {
241
+ . review-box-panel .CodeMirror-scroll {
252
242
max-width : 800px ;
253
243
}
254
244
}
255
245
256
246
@media @mediaXl {
257
- # review-box .CodeMirror-scroll {
247
+ . review-box-panel .CodeMirror-scroll {
258
248
max-width : 900px ;
259
249
}
260
250
}
261
251
262
- .review-box > .segment {
263
- border : none !important ;
252
+ #review-box {
253
+ position : relative ;
254
+ }
255
+
256
+ .review-box-panel {
257
+ position : absolute ;
258
+ min-width : max-content ;
259
+ top : 45px ;
260
+ right : -5px ;
261
+ z-index : 2 ;
264
262
}
265
263
266
264
#review-box .review-comments-counter {
You can’t perform that action at this time.
0 commit comments