1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-14 15:35:35 +00:00

fix-markdown-view (#6728)

* fix-markdown-view

* fix style
This commit is contained in:
yinjianfei-user 2024-09-08 08:17:47 +08:00 committed by GitHub
parent e595e72141
commit 4c295bc38c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 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 === '') ? {(currentPath === '/' || currentPath === '' || Utils.isMarkdownFile(this.props.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>
} }
{pathElem} {Utils.isMarkdownFile(this.props.currentPath) ? null : pathElem}
{this.props.isViewFile && !this.isViewMetadata() && ( {this.props.isViewFile && !Utils.isMarkdownFile(this.props.currentPath) && !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

@ -27,7 +27,7 @@
.seafile-markdown-viewer-modal-body { .seafile-markdown-viewer-modal-body {
padding: 0; padding: 0;
height: 600px; height: calc(100vh / 2 + 130px);
overflow: auto; overflow: auto;
} }

View File

@ -52,7 +52,7 @@ class DirColumnFile extends React.Component {
render() { render() {
const { currentDirent } = this.props; const { currentDirent } = this.props;
const { name } = currentDirent; const { name } = currentDirent || {};
if (this.props.isFileLoadedErr) { if (this.props.isFileLoadedErr) {
return ( return (

View File

@ -91,7 +91,7 @@ class LibContentView extends React.Component {
asyncOperationProgress: 0, asyncOperationProgress: 0,
asyncOperatedFilesLength: 0, asyncOperatedFilesLength: 0,
viewId: '0000', viewId: '0000',
currentDirent: null currentDirent: {}
}; };
this.oldonpopstate = window.onpopstate; this.oldonpopstate = window.onpopstate;