1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-13 05:39:59 +00:00

Wiki module improve (#2901)

This commit is contained in:
杨顺强
2019-01-29 11:03:43 +08:00
committed by Daniel Pan
parent d9a2f6ded9
commit 3c2b89dc22
7 changed files with 155 additions and 31 deletions

View File

@@ -31,7 +31,8 @@ class MainPanel extends Component {
onEditClick = (e) => {
e.preventDefault();
window.location.href= siteRoot + 'lib/' + repoID + '/file' + this.props.filePath + '?mode=edit';
let url = siteRoot + 'lib/' + repoID + '/file' + this.props.path + '?mode=edit';
window.open(url);
}
onMainNavBarClick = (e) => {
@@ -69,6 +70,7 @@ class MainPanel extends Component {
render() {
const errMessage = (<div className="message empty-tip err-message"><h2>{gettext('Folder does not exist.')}</h2></div>);
return (
<div className="main-panel wiki-main-panel o-hidden">
<div className="main-panel-top panel-top">
@@ -102,8 +104,9 @@ class MainPanel extends Component {
</div>
</div>
<div className="cur-view-content">
{this.props.isDataLoading && <Loading />}
{(!this.props.isDataLoading && this.props.isViewFile) && (
{!this.props.pathExist && errMessage}
{this.props.pathExist && this.props.isDataLoading && <Loading />}
{(this.props.pathExist && !this.props.isDataLoading && this.props.isViewFile) && (
<WikiMarkdownViewer
markdownContent={this.props.content}
isFileLoading={this.props.isDataLoading}