mirror of
https://github.com/go-gitea/gitea.git
synced 2026-06-17 20:27:10 +02:00
Merge d6353c2da11de1a3e10e2184cfeca97d3381b7a3 into 68692e19d40894cf0c036f986f659b7ed9b298f5
This commit is contained in:
commit
d4fd6988cd
@ -32,6 +32,8 @@ const onItemClick = (e: MouseEvent) => {
|
||||
// - the user didn't press any special key like "Ctrl+Click" (which may have custom browser behavior)
|
||||
// - the editor/commit form isn't dirty (a full page reload shows a confirmation dialog if the form contains unsaved changes)
|
||||
if (!isPlainClick(e) || shouldTriggerAreYouSure()) return;
|
||||
// submodules (commit entry mode) point to external repos, let the browser handle navigation normally
|
||||
if (props.item.entryMode === 'commit') return;
|
||||
e.preventDefault();
|
||||
if (props.item.entryMode === 'tree') doLoadChildren();
|
||||
store.navigateTreeView(props.item.fullPath);
|
||||
|
||||
@ -41,7 +41,8 @@ export function createViewFileTreeStore(props: {repoLink: string, treePath: stri
|
||||
const u = new URL(url, window.origin);
|
||||
u.searchParams.set('only_content', 'true');
|
||||
const response = await GET(u.href);
|
||||
const elViewContent = document.querySelector('.repo-view-content')!;
|
||||
const elViewContent = document.querySelector('.repo-view-content');
|
||||
if (!elViewContent) return;
|
||||
elViewContent.innerHTML = await response.text();
|
||||
const elViewContentData = elViewContent.querySelector('.repo-view-content-data');
|
||||
if (!elViewContentData) return; // if error occurs, there is no such element
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user