1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

import markdown viewer from seafile-editor (#2572)

* import markdown viewer from seafile-editor

* refactor code

* page-scroll
This commit is contained in:
C_Q
2018-12-06 10:04:32 +08:00
committed by Daniel Pan
parent 295a9265e0
commit 4b74fcee56
4 changed files with 58 additions and 212 deletions

View File

@@ -262,19 +262,6 @@ class Wiki extends Component {
this.setState({direntList: newDirentList});
}
onLinkClick = (event) => {
const url = event.target.href;
if (this.isInternalMarkdownLink(url)) {
let path = this.getPathFromInternalMarkdownLink(url);
this.showFile(path);
} else if (this.isInternalDirLink(url)) {
let path = this.getPathFromInternalDirLink(url);
this.showDir(path);
} else {
window.location.href = url;
}
}
onpopstate = (event) => {
if (event.state && event.state.path) {
let path = event.state.path;
@@ -770,7 +757,6 @@ class Wiki extends Component {
direntList={this.state.direntList}
selectedDirentList={this.state.selectedDirentList}
updateDirent={this.updateDirent}
onLinkClick={this.onLinkClick}
onSideNavMenuClick={this.onSideNavMenuClick}
onSearchedClick={this.onSearchedClick}
onMainNavBarClick={this.onMainNavBarClick}