Merge branch 'master' of https://github.com/bitpay/copay into feat/balance-modal

This commit is contained in:
Andy Phillipson 2016-12-13 17:49:09 -05:00
commit 58478b8113
60 changed files with 4475 additions and 2636 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, $ionicHistory, profileService, lodash, configService, gettextCatalog, platformInfo, walletService, txpModalService, externalLinkService, popupService, addressbookService, storageService, $ionicScrollDelegate, $window) {
angular.module('copayApp.controllers').controller('walletDetailsController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, $ionicHistory, profileService, lodash, configService, platformInfo, walletService, txpModalService, externalLinkService, popupService, addressbookService, storageService, $ionicScrollDelegate, $window) {
var HISTORY_SHOW_LIMIT = 10;
var currentTxHistoryPage = 0;
@ -316,7 +316,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
var scrollWatcherInitialized;
$scope.$on("$ionicView.enter", function(event, data) {
setAndroidStatusBarColor();
if ($scope.isCordova && $scope.isAndroid) setAndroidStatusBarColor();
if (scrollWatcherInitialized || !$scope.amountIsCollapsible) {
return;
}
@ -349,7 +349,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
});
$scope.$on("$ionicView.beforeLeave", function(event, data) {
if($window.StatusBar) {
if ($window.StatusBar) {
$window.StatusBar.backgroundColorByHexString('#1e3186');
}
});
@ -362,20 +362,18 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
function setAndroidStatusBarColor() {
var SUBTRACT_AMOUNT = 15;
if(!$scope.isAndroid) {
return;
}
var rgb = hexToRgb($scope.wallet.color);
var keys = Object.keys(rgb);
keys.forEach(function(k) {
if(rgb[k] - SUBTRACT_AMOUNT < 0) {
if (rgb[k] - SUBTRACT_AMOUNT < 0) {
rgb[k] = 0;
} else {
rgb[k] -= SUBTRACT_AMOUNT;
}
});
var statusBarColorHexString = rgbToHex(rgb.r, rgb.g, rgb.b);
$window.StatusBar.backgroundColorByHexString(statusBarColorHexString);
if ($window.StatusBar)
$window.StatusBar.backgroundColorByHexString(statusBarColorHexString);
}
function hexToRgb(hex) {