1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-22 03:47:09 +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

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