File tree 3 files changed +20
-11
lines changed
3 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ export async function importEasyMDE() {
50
50
/**
51
51
* create an EasyMDE editor for comment
52
52
* @param textarea jQuery or HTMLElement
53
+ * @param easyMDEOptions the options for EasyMDE
53
54
* @returns {null|EasyMDE }
54
55
*/
55
- export async function createCommentEasyMDE ( textarea ) {
56
+ export async function createCommentEasyMDE ( textarea , easyMDEOptions = { } ) {
56
57
if ( textarea instanceof jQuery ) {
57
58
textarea = textarea [ 0 ] ;
58
59
}
@@ -61,6 +62,7 @@ export async function createCommentEasyMDE(textarea) {
61
62
}
62
63
63
64
const EasyMDE = await importEasyMDE ( ) ;
65
+
64
66
const easyMDE = new EasyMDE ( {
65
67
autoDownloadFontAwesome : false ,
66
68
element : textarea ,
@@ -104,8 +106,7 @@ export async function createCommentEasyMDE(textarea) {
104
106
className : 'fa fa-file' ,
105
107
title : 'Revert to simple textarea' ,
106
108
} ,
107
- ] ,
108
- } ) ;
109
+ ] , ...easyMDEOptions } ) ;
109
110
const inputField = easyMDE . codemirror . getInputField ( ) ;
110
111
inputField . classList . add ( 'js-quick-submit' ) ;
111
112
easyMDE . codemirror . setOption ( 'extraKeys' , {
Original file line number Diff line number Diff line change @@ -459,7 +459,9 @@ export function initRepoPullRequestReview() {
459
459
const $reviewBox = $ ( '.review-box' ) ;
460
460
if ( $reviewBox . length === 1 ) {
461
461
( async ( ) => {
462
- await createCommentEasyMDE ( $reviewBox . find ( 'textarea' ) ) ;
462
+ // 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; }`
463
+ // the temporary solution is to make the editor's height smaller (about 4 lines). GitHub also only show 4 lines for default. We can improve the UI (including Dropzone area) in future
464
+ await createCommentEasyMDE ( $reviewBox . find ( 'textarea' ) , { minHeight : '80px' } ) ;
463
465
initCompImagePaste ( $reviewBox ) ;
464
466
} ) ( ) ;
465
467
}
Original file line number Diff line number Diff line change 1
- .dropzone {
2
- border : 2px dashed var (--color-secondary ) !important ;
3
- background : none !important ;
4
- box-shadow : none !important ;
5
- padding : 0 !important ;
6
- min-height : 5rem !important ;
7
- border-radius : 4px !important ;
1
+ .ui .field {
2
+ .dropzone {
3
+ border : 2px dashed var (--color-secondary );
4
+ background : none ;
5
+ box-shadow : none ;
6
+ padding : 0 ;
7
+ border-radius : 4px ;
8
+ min-height : 0 ;
9
+ margin-top : -1em ; // we have another `field` above, it's usually an EasyMDE editor with "status bar", so we do not need the space above.
10
+ .dz-message {
11
+ margin : 10px 0 ;
12
+ }
13
+ }
8
14
}
9
15
10
16
.dropzone .dz-button {
You can’t perform that action at this time.
0 commit comments