Adds share button for customized amounts

This commit is contained in:
Gustavo Maximiliano Cortez 2015-09-11 14:44:52 -03:00
parent 66820f7661
commit 7c303900bb
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
2 changed files with 17 additions and 0 deletions

View File

@ -17,6 +17,13 @@
<ul class="no-bullet size-14 m0">
<li class="line-b p10 oh text-center">
<qrcode size="220" data="bitcoin:{{addr + '?amount=' + customizedAmountBtc}}"></qrcode>
<div class="m10t text-center" ng-show="isCordova">
<span class="button outline dark-gray tiny round"
ng-click="shareAddress('bitcoin:' + addr + '?amount=' + customizedAmountBtc)">
<i class="fi-share"></i>
<span translate>Share address</span>
</span>
</div>
</li>
</ul>
<h4 class="title m0" translate>Details</h4>

View File

@ -462,6 +462,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
$scope.unitDecimals = self.unitDecimals;
var satToUnit = 1 / self.unitToSatoshi;
$scope.showAlternative = false;
$scope.isCordova = isCordova;
Object.defineProperty($scope,
"_customAlternative", {
@ -516,6 +517,15 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
$scope.showAlternative = !$scope.showAlternative;
};
$scope.shareAddress = function(uri) {
if (isCordova) {
if (isMobile.Android() || isMobile.Windows()) {
window.ignoreMobilePause = true;
}
window.plugins.socialsharing.share(uri, null, null, null);
}
};
$scope.cancel = function() {
$modalInstance.dismiss('cancel');
};