mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-22 20:08:19 +00:00
@@ -199,6 +199,9 @@ class DirentGridItem extends React.Component {
|
||||
dirHref = siteRoot + 'library/' + this.props.repoID + '/' + this.props.currentRepoInfo.repo_name + Utils.encodePath(direntPath);
|
||||
}
|
||||
let fileHref = siteRoot + 'lib/' + this.props.repoID + '/file' + Utils.encodePath(direntPath);
|
||||
if (dirent.is_sdoc_revision && dirent.revision_id) {
|
||||
fileHref = siteRoot + 'lib/' + this.props.repoID + '/revisions/' + dirent.revision_id + '/';
|
||||
}
|
||||
|
||||
let gridClass = 'grid-file-img-link cursor-pointer';
|
||||
gridClass += this.state.isGridSelected ? ' grid-selected-active' : ' ';
|
||||
|
@@ -673,6 +673,9 @@ class DirentListItem extends React.Component {
|
||||
dirHref = siteRoot + 'library/' + this.props.repoID + '/' + this.props.currentRepoInfo.repo_name + Utils.encodePath(direntPath);
|
||||
}
|
||||
let fileHref = siteRoot + 'lib/' + this.props.repoID + '/file' + Utils.encodePath(direntPath);
|
||||
if (dirent.is_sdoc_revision && dirent.revision_id) {
|
||||
fileHref = siteRoot + 'lib/' + this.props.repoID + '/revisions/' + dirent.revision_id + '/';
|
||||
}
|
||||
|
||||
let toolTipID = '';
|
||||
let tagTitle = '';
|
||||
|
@@ -39,6 +39,8 @@ class Dirent {
|
||||
}
|
||||
if (Utils.isSdocFile(json.name)) {
|
||||
this.is_sdoc_draft = json.is_sdoc_draft || false;
|
||||
this.is_sdoc_revision = json.is_sdoc_revision || false;
|
||||
this.revision_id = json.revision_id || null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1264,7 +1264,10 @@ class LibContentView extends React.Component {
|
||||
if (this.state.currentMode === 'column' && Utils.isMarkdownFile(direntPath)) {
|
||||
this.showColumnMarkdownFile(direntPath);
|
||||
} else {
|
||||
const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(direntPath);
|
||||
let url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(direntPath);
|
||||
if (dirent.is_sdoc_revision && dirent.revision_id) {
|
||||
url = siteRoot + 'lib/' + repoID + '/revisions/' + dirent.revision_id + '/';
|
||||
}
|
||||
|
||||
let isWeChat = Utils.isWeChat();
|
||||
if (!isWeChat) {
|
||||
@@ -1633,7 +1636,11 @@ class LibContentView extends React.Component {
|
||||
this.showColumnMarkdownFile(node.path);
|
||||
}
|
||||
} else {
|
||||
const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(node.path);
|
||||
let url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(node.path);
|
||||
let dirent = node.object;
|
||||
if (dirent.is_sdoc_revision && dirent.revision_id) {
|
||||
url = siteRoot + 'lib/' + repoID + '/revisions/' + dirent.revision_id + '/';
|
||||
}
|
||||
window.open(url);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user