diff --git a/css/main.css b/css/main.css index ff3c5f725..83a2ad75f 100644 --- a/css/main.css +++ b/css/main.css @@ -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%; + } +} + + /*-----------------------------------------------------------------*/ diff --git a/js/controllers/addresses.js b/js/controllers/addresses.js index 907bfc7ef..c81a10fc3 100644 --- a/js/controllers/addresses.js +++ b/js/controllers/addresses.js @@ -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'); }; diff --git a/js/directives.js b/js/directives.js index b1d6c3b35..3fac18f34 100644 --- a/js/directives.js +++ b/js/directives.js @@ -198,24 +198,31 @@ 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() { - var message = attrs.ngReallyMessage; - if (message && confirm(message)) { - scope.$apply(attrs.ngReallyClick); - } + window.open('bitcoin:'+attrs.address, '_blank'); }); } } - } -]) - + }) + // From https://gist.github.com/asafge/7430497 + .directive('ngReallyClick', [function() { + return { + restrict: 'A', + link: function(scope, element, attrs) { + element.bind('click', function() { + var message = attrs.ngReallyMessage; + if (message && confirm(message)) { + scope.$apply(attrs.ngReallyClick); + } + }); + } + } + } + ]) .directive('match', function () { return { require: 'ngModel', @@ -231,5 +238,4 @@ angular.module('copayApp.directives') }); } }; - }) -; + }); diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index 7bae6bdce..ea670355b 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -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; diff --git a/test/unit/services/servicesSpec.js b/test/unit/services/servicesSpec.js index 0358d1b74..aa7f7e2c8 100644 --- a/test/unit/services/servicesSpec.js +++ b/test/unit/services/servicesSpec.js @@ -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); }); diff --git a/views/includes/sidebar-mobile.html b/views/includes/sidebar-mobile.html index 5b634fe1a..506fcc54a 100644 --- a/views/includes/sidebar-mobile.html +++ b/views/includes/sidebar-mobile.html @@ -24,16 +24,16 @@
- Available + Locked {{availableBalance || 0|noFractionNumber}} {{$root.unitName}} - + tooltip-placement="bottom">{{lockedBalance || 0|noFractionNumber}} {{$root.unitName}} +  
diff --git a/views/includes/sidebar.html b/views/includes/sidebar.html index d57e4075a..3d33607d8 100644 --- a/views/includes/sidebar.html +++ b/views/includes/sidebar.html @@ -32,16 +32,16 @@ |noFractionNumber}} {{$root.unitName}}
- Available + Locked   {{availableBalance || 0|noFractionNumber}} {{$root.unitName}} - + tooltip-placement="bottom">{{lockedBalance || 0|noFractionNumber}} {{$root.unitName}} +  
diff --git a/views/modals/qr-address.html b/views/modals/qr-address.html index 59eb264db..f51b13e1f 100644 --- a/views/modals/qr-address.html +++ b/views/modals/qr-address.html @@ -9,7 +9,7 @@

{{address.balance || 0|noFractionNumber}} {{$root.unitName}}

-