mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 01:41:39 +00:00
fix canEdit in read only and lock
This commit is contained in:
@@ -24,7 +24,7 @@ import 'codemirror/lib/codemirror.css';
|
|||||||
import './css/text-file-view.css';
|
import './css/text-file-view.css';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
err, fileExt, fileContent, repoID, filePath, fileName
|
err, fileExt, fileContent, repoID, filePath, fileName, canEditFile
|
||||||
} = window.app.pageOptions;
|
} = window.app.pageOptions;
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
@@ -34,7 +34,8 @@ const options = {
|
|||||||
theme: 'default',
|
theme: 'default',
|
||||||
textWrapping: true,
|
textWrapping: true,
|
||||||
lineWrapping: 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 {
|
class ViewFileText extends React.Component {
|
||||||
|
Reference in New Issue
Block a user