1
0
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:
Michael An
2024-10-31 12:40:09 +08:00
committed by GitHub
parent 22bc1cadbe
commit 73ddd29170
2 changed files with 3 additions and 7 deletions

View File

@@ -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"

View File

@@ -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>