Replace iframe for window.open _blank

This commit is contained in:
Yemel Jardi 2014-07-17 22:35:24 -03:00
commit d484c5ab49
4 changed files with 7 additions and 8 deletions

View file

@ -9,7 +9,7 @@ BackupService.prototype.getName = function(wallet) {
return (wallet.name ? (wallet.name + '-') : '') + wallet.id;
};
BackupService.prototype.download = function(wallet, scope) {
BackupService.prototype.download = function(wallet) {
var ew = wallet.toEncryptedObj();
var partial = !wallet.publicKeyRing.isComplete();
var walletName = this.getName(wallet) + (partial ? '-Partial' : '');
@ -30,13 +30,13 @@ BackupService.prototype.download = function(wallet, scope) {
}
// throw an email intent if we are in the mobile version
if (window.xwalk && scope) {
if (window.xwalk) {
var name = wallet.name ? wallet.name + ' ' : '';
var partial = partial ? 'Partial ' : '';
var subject = 'Copay - ' + name + 'Wallet ' + partial + 'Backup';
var body = 'This is the encrypted backup of the wallet ' + wallet.id + ':\n\n' + ew;
scope.mobileBackupURI = encodeURI('mailto:?subject=' + subject + '&body=' + body);
return;
var mailURL = encodeURI('mailto:?subject=' + subject + '&body=' + body);
return window.open(mailURL,'_blank');
}
// otherwise lean on the browser implementation