1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-14 06:11:16 +00:00

Fix download python file bug (#6736)

* fix download py file bug

* download in current tab
This commit is contained in:
Michael An
2024-09-09 13:55:17 +08:00
committed by GitHub
parent 63e1802bcf
commit e6261c1c3a
2 changed files with 2 additions and 6 deletions

View File

@@ -162,7 +162,6 @@ class FileToolbar extends React.Component {
id="download-file"
icon="download"
text={gettext('Download')}
tag="a"
href="?dl=1"
/>
)}
@@ -177,7 +176,6 @@ class FileToolbar extends React.Component {
id="open-via-client"
icon="client"
text={gettext('Open via Client')}
tag="a"
href={`seafile://openfile?repo_id=${encodeURIComponent(repoID)}&path=${encodeURIComponent(filePath)}`}
/>
)}

View File

@@ -8,7 +8,6 @@ const propTypes = {
icon: PropTypes.string.isRequired,
text: PropTypes.string.isRequired,
onClick: PropTypes.func,
tag: PropTypes.string,
href: PropTypes.string
};
@@ -41,14 +40,13 @@ class IconButton extends React.Component {
</Tooltip>
</>
);
if (this.props.tag && this.props.tag == 'a') {
if (this.props.href) {
return (
<div
id={this.props.id}
className='file-toolbar-btn'
tag="a"
href={this.props.href}
aria-label={this.props.text}
onClick={() => window.open(this.props.href, '_parent')}
>
{btnContent}
</div>