File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,6 @@ export function initRepoEditor() {
3838 const dropzoneUpload = document . querySelector < HTMLElement > ( '.page-content.repository.editor.upload .dropzone' ) ;
3939 if ( dropzoneUpload ) initDropzone ( dropzoneUpload ) ;
4040
41- const editArea = document . querySelector < HTMLTextAreaElement > ( '.page-content.repository.editor textarea#edit_area' ) ;
42- if ( ! editArea ) return ;
43-
4441 for ( const el of queryElems < HTMLInputElement > ( document , '.js-quick-pull-choice-option' ) ) {
4542 el . addEventListener ( 'input' , ( ) => {
4643 if ( el . value === 'commit-to-new-branch' ) {
@@ -55,6 +52,7 @@ export function initRepoEditor() {
5552 }
5653
5754 const filenameInput = document . querySelector < HTMLInputElement > ( '#file-name' ) ;
55+ if ( ! filenameInput ) return ;
5856 function joinTreePath ( ) {
5957 const parts = [ ] ;
6058 for ( const el of document . querySelectorAll ( '.breadcrumb span.section' ) ) {
@@ -144,6 +142,10 @@ export function initRepoEditor() {
144142 }
145143 } ) ;
146144
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+
147149 const elForm = document . querySelector < HTMLFormElement > ( '.repository.editor .edit.form' ) ;
148150 initEditPreviewTab ( elForm ) ;
149151
You can’t perform that action at this time.
0 commit comments