mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 23:48:47 +00:00
fix view file code-mirror bug (#6975)
This commit is contained in:
@@ -117,7 +117,7 @@ class FileToolbar extends React.Component {
|
||||
return (
|
||||
<Fragment>
|
||||
<div className="d-none d-md-flex justify-content-between align-items-center flex-shrink-0 ml-4">
|
||||
{(fileType == 'PDF' && canDownloadFile ) && (
|
||||
{(fileType == 'PDF' && canDownloadFile) && (
|
||||
<IconButton
|
||||
id="seafile-pdf-print"
|
||||
icon="print"
|
||||
|
@@ -23,17 +23,13 @@ class SeafileCodeMirror extends React.Component {
|
||||
readOnly: true,
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.options = null;
|
||||
}
|
||||
|
||||
onChange = (value) => {
|
||||
this.props.onChange && this.props.onChange(value);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { value, readOnly, fileExt } = this.props;
|
||||
const extensions = [...getLanguageExtensions(fileExt).filter(item => item !== null)];
|
||||
return (
|
||||
<div className='seafile-code-mirror-container'>
|
||||
<CodeMirror
|
||||
@@ -41,7 +37,7 @@ class SeafileCodeMirror extends React.Component {
|
||||
basicSetup={DEFAULT_CODEMIRROR_OPTIONS}
|
||||
theme={myTheme}
|
||||
readOnly={readOnly}
|
||||
extensions={[...getLanguageExtensions(fileExt)]}
|
||||
extensions={extensions}
|
||||
onChange={this.onChange}
|
||||
/>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user