File tree Expand file tree Collapse file tree 9 files changed +35
-52
lines changed Expand file tree Collapse file tree 9 files changed +35
-52
lines changed Original file line number Diff line number Diff line change 2424 {{svg "octicon-diff" 16 "gt-mr-2"}}{{.locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
2525 </div>
2626 </div>
27- <div class="diff-detail-actions gt-df gt-ac">
27+ <div class="diff-detail-actions gt-df gt-ac gt-w-100 ">
2828 {{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
2929 <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"}}">
3131 {{.locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}}
3232 </label>
3333 {{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 ">
33 {{.locale.Tr "repo.diff.review"}}
44 <span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span>
55 {{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">
99 <form class="ui form" action="{{.Link}}/reviews/submit" method="post">
1010 {{.CsrfTokenHtml}}
1111 <input type="hidden" name="commit_id" value="{{.AfterCommitID}}"/>
Original file line number Diff line number Diff line change 7777 <a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">{{.locale.Tr "repo.find_file.go_to_file"}}</a>
7878 {{end}}
7979 {{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}}>
8181 <span class="text">{{.locale.Tr "repo.editor.add_file"}}</span>
8282 <div class="menu">
8383 {{if .CanAddFile}}
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ export function initGlobalEnterQuickSubmit() {
6060export function initGlobalButtonClickOnEnter ( ) {
6161 $ ( document ) . on ( 'keypress' , '.ui.button' , ( e ) => {
6262 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
6364 $ ( e . target ) . trigger ( 'click' ) ;
6465 e . preventDefault ( ) ;
6566 }
Original file line number Diff line number Diff line change @@ -470,7 +470,7 @@ export function initRepoPullRequestReview() {
470470 assignMenuAttributes ( form . find ( '.menu' ) ) ;
471471 } ) ;
472472
473- const $reviewBox = $ ( '.review-box' ) ;
473+ const $reviewBox = $ ( '.review-box-panel ' ) ;
474474 if ( $reviewBox . length === 1 ) {
475475 ( async ( ) => {
476476 // 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() {
487487 return ;
488488 }
489489
490- $ ( '.btn-review' ) . on ( 'click' , function ( e ) {
490+ $ ( '.js- btn-review' ) . on ( 'click' , function ( e ) {
491491 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 ) {
494494 e . preventDefault ( ) ;
495- $ ( this ) . closest ( '.menu' ) . toggle ( 'visible' ) ; // eslint-disable-line
495+ hideElem ( $ ( this ) . closest ( '.review-box-panel' ) ) ;
496496 } ) ;
497497
498498 $ ( document ) . on ( 'click' , 'a.add-code-comment' , async function ( e ) {
Original file line number Diff line number Diff line change @@ -2476,24 +2476,13 @@ table th[data-sortt-desc] {
24762476 }
24772477}
24782478
2479- /* fix up SVG dropdown triangles because fomantic thinks they are icon fonts */
2480- /* see https://github.com/go-gitea/gitea/issues/14014 */
2481- .ui.dropdown > .dropdown.icon ,
2482- .btn-review > .dropdown.icon {
2483- height : auto !important ;
2484- margin-left : .5rem !important ;
2485- margin-top : -1px !important ;
2486- margin-bottom : -1px !important ;
2487- margin-right : -.5rem !important ;
2479+ .ui.dropdown .svg.dropdown.icon ,
2480+ .svg.dropdown.icon {
2481+ margin-top : 0 !important ; // reset the "ui.selection.dropdown > .dropdown.icon {margin-top}", for the Issue Dependencies dropdown
2482+ margin-right : -.5rem !important ; // fix up SVG dropdown triangles because Fomantic thinks they are icon fonts
2483+ height : auto ; // reset the ".ui.dropdown > .dropdown.icon {height}", otherwise the icon would be too small
24882484}
2489- .ui.button.dropdown > .dropdown.icon ,
2490- .btn-review > .dropdown.icon {
2491- float : right !important ;
24922485
2493- @media (max-width : 480px ) {
2494- display : none ;
2495- }
2496- }
24972486.ui.selection.dropdown > .search.icon ,
24982487.ui.selection.dropdown > .delete.icon ,
24992488.ui.selection.dropdown > .dropdown.icon {
Original file line number Diff line number Diff line change 1313}
1414
1515.editor-toolbar {
16- opacity : 1 !important ;
16+ max-width : calc ( 100 vw - 80 px ) ;
1717 border-color : var (--color-secondary );
1818}
1919
Original file line number Diff line number Diff line change 28642864 margin-top : 10px ;
28652865}
28662866
2867- .repo-button-row .dropdown > .dropdown.icon {
2868- margin-left : .25rem !important ;
2869- margin-right : 0 !important ;
2870- }
2871-
28722867.wiki .repo-button-row {
28732868 margin-bottom : 0 ;
28742869}
Original file line number Diff line number Diff line change @@ -220,47 +220,45 @@ a.blob-excerpt:hover {
220220
221221// See the comment of createCommentEasyMDE() for the review editor
222222// 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 {
224224 min-height : 80px ;
225225 max-height : calc (100vh - 360px );
226226}
227227
228228@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 {
240230 max-width : calc (100vw - 70px );
241231 }
242232}
243233
244234@media @mediaMd {
245- # review-box .CodeMirror-scroll {
235+ . review-box-panel .CodeMirror-scroll {
246236 max-width : 700px ;
247237 }
248238}
249239
250240@media @mediaLg {
251- # review-box .CodeMirror-scroll {
241+ . review-box-panel .CodeMirror-scroll {
252242 max-width : 800px ;
253243 }
254244}
255245
256246@media @mediaXl {
257- # review-box .CodeMirror-scroll {
247+ . review-box-panel .CodeMirror-scroll {
258248 max-width : 900px ;
259249 }
260250}
261251
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 ;
264262}
265263
266264#review-box .review-comments-counter {
You can’t perform that action at this time.
0 commit comments