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:
@@ -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)}`}
|
||||
/>
|
||||
)}
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user