0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-11-02 00:27:24 +01:00

only query once

This commit is contained in:
wxiaoguang 2025-10-29 20:48:57 +08:00
parent eda0b30f97
commit 3e1593aa03

View File

@ -30,8 +30,9 @@ export function createViewFileTreeStore(props: {repoLink: string, treePath: stri
const response = await GET(u.href);
const elViewContent = document.querySelector('.repo-view-content');
elViewContent.innerHTML = await response.text();
const t1 = elViewContent.querySelector('.repo-view-content-data').getAttribute('data-document-title');
const t2 = elViewContent.querySelector('.repo-view-content-data').getAttribute('data-document-title-common');
const elViewContentData = elViewContent.querySelector('.repo-view-content-data');
const t1 = elViewContentData.getAttribute('data-document-title');
const t2 = elViewContentData.getAttribute('data-document-title-common');
document.title = `${t1} - ${t2}`; // follow the format in head.tmpl: <head><title>...</title></head>
},