1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-21 11:27:18 +00:00

Wiki mode improve (#2539)

This commit is contained in:
Daniel Pan
2018-11-22 11:26:00 +08:00
committed by GitHub
parent 921089bd01
commit fb5d105e6e
24 changed files with 751 additions and 629 deletions

View File

@@ -77,7 +77,7 @@ class CreateFile extends React.Component {
});
} else if (pos === 0 ) {
this.setState({
childName: '(draft)' + this.state.childname,
childName: '(draft)' + this.state.childName,
isDraft: !this.state.isdraft
});
} else {
@@ -93,10 +93,11 @@ class CreateFile extends React.Component {
}
componentDidMount() {
if (this.props.parentPath === '/') {
this.setState({parentPath: this.props.parentPath});
let parentPath = this.props.parentPath;
if (parentPath[parentPath.length - 1] === '/') { // mainPanel
this.setState({parentPath: parentPath});
} else {
this.setState({parentPath: this.props.parentPath + '/'});
this.setState({parentPath: parentPath + '/'}); // sidePanel
}
this.newInput.focus();
this.newInput.setSelectionRange(0,0);