Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Jan 12, 2025
1 parent be4e961 commit 0413d0b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions web_src/js/features/repo-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ export function initRepoEditor() {
const dropzoneUpload = document.querySelector<HTMLElement>('.page-content.repository.editor.upload .dropzone');
if (dropzoneUpload) initDropzone(dropzoneUpload);

const editArea = document.querySelector<HTMLTextAreaElement>('.page-content.repository.editor textarea#edit_area');
if (!editArea) return;

for (const el of queryElems<HTMLInputElement>(document, '.js-quick-pull-choice-option')) {
el.addEventListener('input', () => {
if (el.value === 'commit-to-new-branch') {
Expand All @@ -55,6 +52,7 @@ export function initRepoEditor() {
}

const filenameInput = document.querySelector<HTMLInputElement>('#file-name');
if (!filenameInput) return;
function joinTreePath() {
const parts = [];
for (const el of document.querySelectorAll('.breadcrumb span.section')) {
Expand Down Expand Up @@ -144,6 +142,10 @@ export function initRepoEditor() {
}
});

// on the upload page, there is no editor(textarea)
const editArea = document.querySelector<HTMLTextAreaElement>('.page-content.repository.editor textarea#edit_area');
if (!editArea) return;

const elForm = document.querySelector<HTMLFormElement>('.repository.editor .edit.form');
initEditPreviewTab(elForm);

Expand Down

0 comments on commit 0413d0b

Please sign in to comment.