1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 19:29:56 +00:00

[shared file view] markdown: redesigned it for 'no outline' & 'short outline'

This commit is contained in:
llj
2022-05-30 18:47:52 +08:00
parent 7db323a63a
commit fe62254f31
4 changed files with 23 additions and 11 deletions

View File

@@ -65,6 +65,13 @@ class FileContent extends React.Component {
return Utils.changeMarkdownNodes(value, this.changeImageURL);
}
updateForNoOutline = () => {
const $outline = document.querySelector('.md-view .seafile-markdown-outline');
const $main = document.querySelector('.md-view .article');
$outline.className += ' d-none';
$main.className += ' article-no-outline';
}
render() {
if (err) {
return <SharedFileViewTip />;
@@ -76,11 +83,12 @@ class FileContent extends React.Component {
return (
<div className="shared-file-view-body">
<div className="md-view">
<div className="md-view h-100">
<MarkdownViewer
scriptSource={mediaUrl + 'js/mathjax/tex-svg.js'}
markdownContent={this.state.markdownContent}
showTOC={true}
updateForNoOutline={this.updateForNoOutline}
activeTitleIndex={''}
serviceURL={serviceURL}
sharedToken={sharedToken}