fix conflict qr modal

This commit is contained in:
bechi 2014-08-01 10:55:47 -03:00
commit 1a6585a358
8 changed files with 44 additions and 29 deletions

View File

@ -1085,4 +1085,12 @@ a.text-white:hover {color: #ccc;}
text-align: left;
}
@media only screen and (min-width: 40.063em) {
dialog.tiny, .reveal-modal.tiny {
width: 50%;
margin-left: -25%;
}
}
/*-----------------------------------------------------------------*/

View File

@ -20,13 +20,6 @@ angular.module('copayApp.controllers').controller('AddressesController',
var ModalInstanceCtrl = function ($scope, $modalInstance, address) {
$scope.address = address;
$scope.openExternal = function(address) {
var url = 'bitcoin:' + address;
if (window.cordova) return window.open(url, '_blank');
window.location = url;
}
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};

View File

@ -198,10 +198,18 @@ angular.module('copayApp.directives')
}
};
})
// From https://gist.github.com/asafge/7430497
.directive('ngReallyClick', [
function() {
.directive('openExternal', function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
window.open('bitcoin:'+attrs.address, '_blank');
});
}
}
})
// From https://gist.github.com/asafge/7430497
.directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
@ -214,8 +222,7 @@ angular.module('copayApp.directives')
}
}
}
])
])
.directive('match', function () {
return {
require: 'ngModel',
@ -231,5 +238,4 @@ angular.module('copayApp.directives')
});
}
};
})
;
});

View File

@ -212,6 +212,10 @@ angular.module('copayApp.services')
$rootScope.totalBalanceBTC = (balanceSat / COIN);
$rootScope.availableBalance = safeBalanceSat * satToUnit;
$rootScope.availableBalanceBTC = (safeBalanceSat / COIN);
$rootScope.lockedBalance = (balanceSat - safeBalanceSat) * satToUnit;
$rootScope.lockedBalanceBTC = (balanceSat - safeBalanceSat) / COIN;
var balanceByAddr = {};
for (var ii in balanceByAddrSat) {
balanceByAddr[ii] = balanceByAddrSat[ii] * satToUnit;

View File

@ -93,8 +93,12 @@ describe("Unit: controllerUtils", function() {
controllerUtils.updateBalance(function() {
expect($rootScope.totalBalanceBTC).to.be.equal(1.00000001);
expect($rootScope.availableBalanceBTC).to.be.equal(0.90000002);
expect($rootScope.lockedBalanceBTC).to.be.equal(0.09999999);
expect($rootScope.totalBalance).to.be.equal(1000000.01);
expect($rootScope.availableBalance).to.be.equal(900000.02);
expect($rootScope.lockedBalance).to.be.equal(99999.99);
expect($rootScope.addrInfos).not.to.equal(null);
expect($rootScope.addrInfos[0].address).to.equal(Waddr);
});

View File

@ -24,16 +24,16 @@
</span>
</div>
<div>
Available
Locked
<span ng-if="$root.updatingBalance">
<i class="fi-bitcoin-circle icon-rotate spinner"></i>
</span>
<span ng-show="!$root.updatingBalance"
data-options="disable_for_touch:true"
tooltip="{{availableBalanceBTC || 0 |noFractionNumber:8}} BTC"
tooltip="{{lockedBalanceBTC || 0 |noFractionNumber:8}} BTC"
tooltip-trigger="mouseenter"
tooltip-placement="bottom">{{availableBalance || 0|noFractionNumber}} {{$root.unitName}}
</span>
tooltip-placement="bottom">{{lockedBalance || 0|noFractionNumber}} {{$root.unitName}}
</span> &nbsp;<i class="fi-info medium" tooltip="Balance locked in pending transaction proposals" tooltip-placement="bottom"></i>
</div>
<div class="line-sidebar-b"></div>
</div>

View File

@ -32,16 +32,16 @@
|noFractionNumber}} {{$root.unitName}}
</span>
<br>
Available
Locked &nbsp;
<span ng-if="$root.updatingBalance">
<i class="fi-bitcoin-circle icon-rotate spinner"></i>
</span>
<span ng-show="!$root.updatingBalance"
data-options="disable_for_touch:true"
tooltip="{{availableBalanceBTC || 0 |noFractionNumber:8}} BTC"
tooltip="{{lockedBalanceBTC || 0 |noFractionNumber:8}} BTC"
tooltip-trigger="mouseenter"
tooltip-placement="bottom">{{availableBalance || 0|noFractionNumber}} {{$root.unitName}}
</span>
tooltip-placement="bottom">{{lockedBalance || 0|noFractionNumber}} {{$root.unitName}}
</span> &nbsp;<i class="fi-info medium" tooltip="Balance locked in pending transaction proposals" tooltip-placement="bottom"></i>
</div>
<div class="line-sidebar"></div>
</header>

View File

@ -9,7 +9,7 @@
<p class="m15b" ng-if="!$root.updatingBalance">
{{address.balance || 0|noFractionNumber}} {{$root.unitName}}
</p>
<button class="m15t button secondary" ng-click="openExternal(address.address)">
<button class="m15t button secondary" open-external address="{{address.address}}">
<i class="fi-link">&nbsp;</i> Open in external aplication
</button>
</div>