mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 13:50:07 +00:00
Markdown previewer location (#3833)
* Change the position in the markdown preview page * modify func name * optimization code
This commit is contained in:
@@ -87,14 +87,7 @@ class DirTool extends React.Component {
|
||||
let trashUrl = siteRoot + 'repo/' + repoID + '/trash/';
|
||||
let historyUrl = siteRoot + 'repo/history/' + repoID + '/';
|
||||
if (permission) {
|
||||
if (isFile) { // isFile
|
||||
historyUrl = siteRoot + 'repo/file_revisions/' + repoID + '/?p=' + Utils.encodePath(currentPath);
|
||||
return (
|
||||
<ul className="path-toolbar">
|
||||
<li className="toolbar-item"><a className="op-link sf2-icon-history" href={historyUrl} title={gettext('History')} aria-label={gettext('History')}></a></li>
|
||||
</ul>
|
||||
);
|
||||
} else {
|
||||
if (!isFile) {
|
||||
if (name) { // name not '' is not root path
|
||||
trashUrl = siteRoot + 'repo/' + repoID + '/trash/?path=' + encodeURIComponent(currentPath);
|
||||
return (
|
||||
|
@@ -85,6 +85,11 @@ class ViewFileToolbar extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
onHistoryClick = () => {
|
||||
let historyUrl = siteRoot + 'repo/file_revisions/' + this.props.repoID + '/?p=' + Utils.encodePath(this.props.path);
|
||||
location.href = historyUrl;
|
||||
}
|
||||
|
||||
render() {
|
||||
let { filePermission } = this.props;
|
||||
let name = Utils.getFileName(this.props.path);
|
||||
@@ -114,6 +119,7 @@ class ViewFileToolbar extends React.Component {
|
||||
}
|
||||
<DropdownItem onClick={this.onEditFileTagToggle}>{gettext('Tags')}</DropdownItem>
|
||||
<DropdownItem onClick={this.onListRelatedFileToggle}>{gettext('Related Files')}</DropdownItem>
|
||||
<DropdownItem onClick={this.onHistoryClick}>{gettext('History')}</DropdownItem>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user