Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kerwin612 committed Jan 13, 2025
1 parent cac5f1c commit dc63b48
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions web_src/js/components/ViewFileTreeItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type Item = {
name: string;
path: string;
htmlUrl: string;
isFile: boolean;
type: string;
children?: Item[];
};
Expand Down Expand Up @@ -44,7 +44,7 @@ const doLoadFileContent = () => {
<template>
<!--title instead of tooltip above as the tooltip needs too much work with the current methods, i.e. not being loaded or staying open for "too long"-->
<div
v-if="item.isFile" class="item-file"
v-if="item.type !== 'tree'" class="item-file"
:class="{'selected': selectedItem.value === item.path}"
:title="item.name"
@click.stop="doLoadFileContent"
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/features/common-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export function initTargetButtons(target: ParentNode): void {
// There are many "cancel button" elements in modal dialogs, Fomantic UI expects they are button-like elements but never submit a form.
// However, Gitea misuses the modal dialog and put the cancel buttons inside forms, so we must prevent the form submission.
// There are a few cancel buttons in non-modal forms, and there are some dynamically created forms (eg: the "Edit Issue Content")
addDelegatedEventListener(target, 'click', 'form button.ui.cancel.button', (_ /* el */, e) => e.preventDefault());
queryElems(target, 'form button.ui.cancel.button', (el) => el.addEventListener('click', (e) => e.preventDefault()));

queryElems(target, '.show-panel', (el) => el.addEventListener('click', onShowPanelClick));
queryElems(target, '.hide-panel', (el) => el.addEventListener('click', onHidePanelClick));
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/features/repo-view-file-tree-sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function loadChildren(item, recursive?: boolean) {
if (json instanceof Array) {
return json.map((i) => ({
name: i.name,
isFile: i.isFile,
type: i.type,
path: i.path,
children: i.children,
}));
Expand Down

0 comments on commit dc63b48

Please sign in to comment.