1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 01:12:03 +00:00

use head and repo name as title on wiki page (#5230)

* use head and repo name as title on wiki page

* update

* update page title by change file

* optimize style

* fix unordered_list display

* update translation

Co-authored-by: lian <lian@seafile.com>
Co-authored-by: shuntian <978987373@qq.com>
Co-authored-by: 王健辉 <40563566+mrwangjianhui@users.noreply.github.com>
This commit is contained in:
lian
2022-08-05 14:15:37 +08:00
committed by GitHub
parent d00c50b566
commit 16bff600d1
80 changed files with 4260 additions and 4270 deletions

View File

@@ -73,6 +73,11 @@ class WikiMarkdownViewer extends React.Component {
getTitlesInfo = () => {
let titlesInfo = [];
const titleDom = document.querySelectorAll('h1[id^="user-content"]')[0];
if (titleDom) {
const content = titleDom.innerText;
Utils.updateTabTitle(content);
}
let headingList = document.querySelectorAll('h2[id^="user-content"], h3[id^="user-content"]');
for (let i = 0; i < headingList.length; i++) {
titlesInfo.push(headingList[i].offsetTop);