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

fix canEdit in read only and lock

This commit is contained in:
LeoSirius
2019-04-22 22:11:26 +08:00
parent 0de9829258
commit 7aec581ab5

View File

@@ -24,7 +24,7 @@ import 'codemirror/lib/codemirror.css';
import './css/text-file-view.css';
const {
err, fileExt, fileContent, repoID, filePath, fileName
err, fileExt, fileContent, repoID, filePath, fileName, canEditFile
} = window.app.pageOptions;
const options = {
@@ -34,7 +34,8 @@ const options = {
theme: 'default',
textWrapping: true,
lineWrapping: true,
readOnly: false, // set false to let user edit directly
readOnly: !canEditFile,
cursorBlinkRate: canEditFile ? 530 : -1, // default is 530ms
};
class ViewFileText extends React.Component {