File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,6 @@ export function initRepoEditor() {
38
38
const dropzoneUpload = document . querySelector < HTMLElement > ( '.page-content.repository.editor.upload .dropzone' ) ;
39
39
if ( dropzoneUpload ) initDropzone ( dropzoneUpload ) ;
40
40
41
- const editArea = document . querySelector < HTMLTextAreaElement > ( '.page-content.repository.editor textarea#edit_area' ) ;
42
- if ( ! editArea ) return ;
43
-
44
41
for ( const el of queryElems < HTMLInputElement > ( document , '.js-quick-pull-choice-option' ) ) {
45
42
el . addEventListener ( 'input' , ( ) => {
46
43
if ( el . value === 'commit-to-new-branch' ) {
@@ -55,6 +52,7 @@ export function initRepoEditor() {
55
52
}
56
53
57
54
const filenameInput = document . querySelector < HTMLInputElement > ( '#file-name' ) ;
55
+ if ( ! filenameInput ) return ;
58
56
function joinTreePath ( ) {
59
57
const parts = [ ] ;
60
58
for ( const el of document . querySelectorAll ( '.breadcrumb span.section' ) ) {
@@ -144,6 +142,10 @@ export function initRepoEditor() {
144
142
}
145
143
} ) ;
146
144
145
+ // on the upload page, there is no editor(textarea)
146
+ const editArea = document . querySelector < HTMLTextAreaElement > ( '.page-content.repository.editor textarea#edit_area' ) ;
147
+ if ( ! editArea ) return ;
148
+
147
149
const elForm = document . querySelector < HTMLFormElement > ( '.repository.editor .edit.form' ) ;
148
150
initEditPreviewTab ( elForm ) ;
149
151
You can’t perform that action at this time.
0 commit comments