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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user