1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 18:30:53 +00:00

modify wiki-mode to list-mode url (#2675)

This commit is contained in:
杨顺强
2018-12-20 14:36:07 +08:00
committed by Daniel Pan
parent 4c88f5a2bb
commit d9f1bb1035
2 changed files with 3 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ class ViewModeToolbar extends React.Component {
return (
<div className="view-mode btn-group">
<button className={`${baseClass} sf2-icon-list-view ${this.props.currentMode === 'list' ? 'current-mode' : ''}`} id='list' title={gettext('List')} onClick={this.switchViewMode}></button>
<button className={`${baseClass} sf2-icon-grid-view ${this.props.currentMode === 'grid' ? 'current-mode' : ''}`} id='grid' title={gettext('Grid')} onClick={this.switchViewMode}></button>
{/* <button className={`${baseClass} sf2-icon-grid-view ${this.props.currentMode === 'grid' ? 'current-mode' : ''}`} id='grid' title={gettext('Grid')} onClick={this.switchViewMode}></button> */}
<button className={`${baseClass} sf2-icon-two-columns ${this.props.currentMode === 'wiki' ? 'current-mode' : ''}`} id='wiki' title={gettext('wiki')} onClick={this.switchViewMode}></button>
</div>
);

View File

@@ -96,8 +96,9 @@ class MainPanel extends Component {
switchViewMode = (mode) => {
cookie.save('view_mode', mode, { path: '/' });
let repoName = this.state.currentRepoInfo.repo_name;
let dirPath = this.props.isViewFile ? Utils.getDirName(this.props.path) : this.props.path;
window.location.href = siteRoot + '#common/lib/' + repoID + dirPath;
window.location.href = siteRoot + 'library/' + repoID + '/' + repoName + dirPath;
}
onSideNavMenuClick = () => {