mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 15:53:28 +00:00
wiki-init-bug (#2325)
* wiki-init-bug * repair wiki init load bug * add wiki file
This commit is contained in:
committed by
Daniel Pan
parent
4b97e41be2
commit
18b3b68ae5
@@ -147,7 +147,7 @@ class SidePanel extends Component {
|
||||
let currentNode = this.state.currentNode;
|
||||
if (this.isModifyContainsCurrentFile()) {
|
||||
let nodePath = currentNode.path;
|
||||
let filePath = _this.props.currentFileNode.path;
|
||||
let filePath = _this.props.currentFilePath;
|
||||
let start = filePath.indexOf(nodePath);
|
||||
let node = currentNode.getNodeByPath(filePath.slice(start));
|
||||
if (node) {
|
||||
@@ -199,12 +199,14 @@ class SidePanel extends Component {
|
||||
|
||||
isModifyCurrentFile() {
|
||||
let nodeName = this.state.currentNode.name;
|
||||
let fileName = this.props.currentFileNode.name;
|
||||
let filePath = this.props.currentFilePath;
|
||||
let index = filePath.lastIndexOf("/");
|
||||
let fileName = filePath.slice(index+1);
|
||||
return nodeName === fileName;
|
||||
}
|
||||
|
||||
isModifyContainsCurrentFile() {
|
||||
let filePath = this.props.currentFileNode.path;
|
||||
let filePath = this.props.currentFilePath;
|
||||
let nodePath = this.state.currentNode.path;
|
||||
|
||||
if (filePath.indexOf(nodePath) > -1) {
|
||||
@@ -250,7 +252,6 @@ class SidePanel extends Component {
|
||||
componentDidMount() {
|
||||
//init treeview data
|
||||
this.initializeTreeData();
|
||||
|
||||
document.addEventListener('click', this.onHideContextMenu);
|
||||
}
|
||||
|
||||
@@ -299,7 +300,7 @@ class SidePanel extends Component {
|
||||
{this.state.tree_data &&
|
||||
<TreeView
|
||||
permission={this.props.permission}
|
||||
currentFileNode={this.props.currentFileNode}
|
||||
currentFilePath={this.props.currentFilePath}
|
||||
treeData={this.state.tree_data}
|
||||
currentNode={this.state.currentNode}
|
||||
isNodeItemFrezee={this.state.isNodeItemFrezee}
|
||||
|
@@ -114,7 +114,7 @@ class TreeNodeView extends React.Component {
|
||||
treeView={this.props.treeView}
|
||||
isNodeItemFrezee={this.props.isNodeItemFrezee}
|
||||
permission={this.props.permission}
|
||||
currentFileNode={this.props.currentFileNode}
|
||||
currentFilePath={this.props.currentFilePath}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -173,7 +173,7 @@ class TreeNodeView extends React.Component {
|
||||
let node = this.props.node;
|
||||
let { type, icon } = this.getNodeTypeAndIcon();
|
||||
let hlClass = "";
|
||||
if (node.path === this.props.currentFileNode.path) {
|
||||
if (node.path === this.props.currentFilePath) {
|
||||
hlClass = "tree-node-hight-light";
|
||||
}
|
||||
let customClass = "tree-node " + hlClass;
|
||||
|
@@ -53,7 +53,7 @@ class TreeView extends React.PureComponent {
|
||||
node={this.props.treeData.root}
|
||||
isNodeItemFrezee={this.props.isNodeItemFrezee}
|
||||
permission={this.props.permission}
|
||||
currentFileNode={this.props.currentFileNode}
|
||||
currentFilePath={this.props.currentFilePath}
|
||||
onShowContextMenu={this.props.onShowContextMenu}
|
||||
/>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user