1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 03:11:07 +00:00

rewrote 'text file view' & tidied 'file view' code (#2996)

This commit is contained in:
llj
2019-02-25 18:09:17 +08:00
committed by Daniel Pan
parent 9e38f38fd8
commit 4438708040
12 changed files with 321 additions and 485 deletions

View File

@@ -16,7 +16,7 @@ const {
canLockUnlockFile,
repoID, repoName, parentDir, filePerm, filePath,
canEditFile, err,
encoding, // for 'edit', not undefined only for some kinds of files
fileEnc, // for 'edit', not undefined only for some kinds of files (e.g. text file)
canDownloadFile, enableComment
} = window.app.pageOptions;
@@ -70,7 +70,7 @@ class FileToolbar extends React.Component {
icon="fa fa-edit"
text={gettext('Edit')}
tag="a"
href={`${siteRoot}repo/${repoID}/file/edit/?p=${encodeURIComponent(filePath)}&file_enc=${encodeURIComponent(encoding)}`}
href={`${siteRoot}repo/${repoID}/file/edit/?p=${encodeURIComponent(filePath)}&file_enc=${encodeURIComponent(fileEnc)}`}
/>
)}
{canDownloadFile && (