MOBILE-3320 file: Fix file opened twice when second button clicked
parent
365bd02fb5
commit
9dfe556066
|
@ -12,7 +12,7 @@
|
||||||
[canTrustDownload]="!alwaysDownload" (action)="download()" size="small">
|
[canTrustDownload]="!alwaysDownload" (action)="download()" size="small">
|
||||||
</core-download-refresh>
|
</core-download-refresh>
|
||||||
|
|
||||||
<ion-button fill="clear" *ngIf="isDownloaded && isIOS" (click)="openFile(true)" color="dark"
|
<ion-button fill="clear" *ngIf="isDownloaded && isIOS" (click)="openFile($event, true)" color="dark"
|
||||||
[title]="openButtonLabel | translate">
|
[title]="openButtonLabel | translate">
|
||||||
<ion-icon slot="icon-only" [name]="openButtonIcon" aria-hidden="true"></ion-icon>
|
<ion-icon slot="icon-only" [name]="openButtonIcon" aria-hidden="true"></ion-icon>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
|
|
|
@ -144,10 +144,14 @@ export class CoreFileComponent implements OnInit, OnDestroy {
|
||||||
/**
|
/**
|
||||||
* Convenience function to open a file, downloading it if needed.
|
* Convenience function to open a file, downloading it if needed.
|
||||||
*
|
*
|
||||||
|
* @param ev Click event (if any).
|
||||||
* @param isOpenButton Whether the open button was clicked.
|
* @param isOpenButton Whether the open button was clicked.
|
||||||
* @return Promise resolved when file is opened.
|
* @return Promise resolved when file is opened.
|
||||||
*/
|
*/
|
||||||
openFile(isOpenButton = false): Promise<void> {
|
openFile(ev?: Event, isOpenButton = false): Promise<void> {
|
||||||
|
ev?.preventDefault();
|
||||||
|
ev?.stopPropagation();
|
||||||
|
|
||||||
const options: CoreUtilsOpenFileOptions = {};
|
const options: CoreUtilsOpenFileOptions = {};
|
||||||
if (isOpenButton) {
|
if (isOpenButton) {
|
||||||
// Use the non-default method.
|
// Use the non-default method.
|
||||||
|
|
Loading…
Reference in New Issue