mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
abstract dir-operation-toolbar and view-mode-toolbar (#2569)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import moment from 'moment';
|
||||
import cookie from 'react-cookies';
|
||||
import { gettext, repoID, serviceUrl, initialPath, isDir } from './utils/constants';
|
||||
import { seafileAPI } from './utils/seafile-api';
|
||||
import { Utils } from './utils/utils';
|
||||
@@ -171,22 +170,6 @@ class Wiki extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
switchViewMode = (mode) => {
|
||||
let dirPath;
|
||||
let tree = this.state.treeData;
|
||||
let node = tree.getNodeByPath(this.state.path);
|
||||
if (node.isDir()) {
|
||||
dirPath = this.state.path;
|
||||
} else {
|
||||
const index = this.state.path.lastIndexOf('/');
|
||||
dirPath = this.state.path.substring(0, index);
|
||||
}
|
||||
|
||||
cookie.save('view_mode', mode, { path: '/' });
|
||||
|
||||
window.location.href = serviceUrl + '/#common/lib/' + repoID + dirPath;
|
||||
}
|
||||
|
||||
loadSidePanel = (filePath) => {
|
||||
seafileAPI.listDir(repoID, '/',{recursive: true}).then(items => {
|
||||
const files = items.data.map(item => {
|
||||
@@ -788,7 +771,6 @@ class Wiki extends Component {
|
||||
latestContributor={this.state.latestContributor}
|
||||
direntList={this.state.direntList}
|
||||
selectedDirentList={this.state.selectedDirentList}
|
||||
switchViewMode={this.switchViewMode}
|
||||
updateDirent={this.updateDirent}
|
||||
onLinkClick={this.onLinkClick}
|
||||
onSideNavMenuClick={this.onSideNavMenuClick}
|
||||
|
Reference in New Issue
Block a user