1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-17 22:47:59 +00:00

fix markdown preview (#6735)

This commit is contained in:
Michael An 2024-09-09 11:55:41 +08:00 committed by GitHub
parent 908150f43b
commit 6e5c50c4bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 7 deletions

View File

@ -249,7 +249,7 @@ class DirPath extends React.Component {
<span className="path-split">/</span> <span className="path-split">/</span>
</Fragment> </Fragment>
)} )}
{(currentPath === '/' || currentPath === '' || Utils.isMarkdownFile(this.props.currentPath)) ? {(currentPath === '/' || currentPath === '') ?
<DirOperationToolBar <DirOperationToolBar
path={this.props.currentPath} path={this.props.currentPath}
repoID={this.props.repoID} repoID={this.props.repoID}
@ -269,8 +269,8 @@ class DirPath extends React.Component {
</DirOperationToolBar> : </DirOperationToolBar> :
<span className="path-item" data-path="/" onClick={this.onPathClick} role="button">{repoName}</span> <span className="path-item" data-path="/" onClick={this.onPathClick} role="button">{repoName}</span>
} }
{Utils.isMarkdownFile(this.props.currentPath) ? null : pathElem} {pathElem}
{this.props.isViewFile && !Utils.isMarkdownFile(this.props.currentPath) && !this.isViewMetadata() && ( {this.props.isViewFile && !this.isViewMetadata() && (
<InternalLinkOperation repoID={this.props.repoID} path={this.props.currentPath}/> <InternalLinkOperation repoID={this.props.repoID} path={this.props.currentPath}/>
)} )}
{(this.props.isViewFile && fileTags.length !== 0) && {(this.props.isViewFile && fileTags.length !== 0) &&

View File

@ -7,8 +7,8 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
padding: 12px 16px; padding: 0 16px;
height: 50px; height: 48px;
} }
.seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-left-name > span { .seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-left-name > span {

View File

@ -485,7 +485,7 @@ class LibContentView extends React.Component {
// update state // update state
this.setState({ this.setState({
isFileLoading: true, isFileLoading: true,
path: filePath, path: noRedirection ? this.state.path : filePath,
isViewFile: true isViewFile: true
}); });
@ -1902,7 +1902,7 @@ class LibContentView extends React.Component {
onCloseMarkdownViewDialog = () => { onCloseMarkdownViewDialog = () => {
this.setState({ this.setState({
isViewFile: false, isViewFile: false,
path: '/' currentDirent: {},
}); });
}; };