diff --git a/bower.json b/bower.json index b3065ef29..719abb2ff 100644 --- a/bower.json +++ b/bower.json @@ -24,7 +24,6 @@ "angular-load": "0.2.0", "lodash": "~2.4.1", "angular-gravatar": "*", - "fastclick": "*", "angular-touch": "~1.3.0" }, "resolutions": { diff --git a/css/src/mobile.css b/css/src/mobile.css index c39611451..d63300341 100644 --- a/css/src/mobile.css +++ b/css/src/mobile.css @@ -25,9 +25,9 @@ .main { height: 92%; - margin-top: 40px; + margin-top: 30px; margin-left: 0; - margin-bottom: -40px; + margin-bottom: -30px; padding: 20px 0 80px 0; } @@ -53,6 +53,11 @@ line-height: 110%; } + header h1 { + color: #fff; + text-align: center; + } + .col3 a { height: 45px; padding: 12px 5px; @@ -63,6 +68,10 @@ left: 0; } + .right-off-canvas-menu { + background-color: #213140 ; + } + .left-off-canvas-menu { background: #E4E8EC; line-height: 24px; @@ -177,11 +186,6 @@ margin-left: 0; font-size: 14px; } - - .top-balance { - width: auto; - padding: 0 5px; - } a.missing-copayers { bottom: -34px; @@ -204,14 +208,7 @@ .footer-setup { margin-bottom: 50px; - } - - .side-nav.wallets { - padding: 0; - height: 100%; - left: 0; - top: 45px; - } + } ul.off-canvas-list li a:hover { background: transparent; @@ -222,6 +219,18 @@ padding: 0.15rem 0.2rem; } + .side-nav.wallets { + z-index: 100; + overflow-y: inherit; + position: inherit; + height: auto; + border-bottom: none; + } + + .side-nav li.nav-item.selected { + background-color: #3C4E60; + } + } @media (max-width: 640px) { diff --git a/index.html b/index.html index 6e180ceda..953f81515 100644 --- a/index.html +++ b/index.html @@ -38,7 +38,7 @@
- +

Your session is about to expire due to inactivity in {{countdown}} seconds

@@ -56,37 +56,40 @@ - - + -
+ + +
+
+
+ - +
-
- -
-
-
+
diff --git a/js/controllers/createProfile.js b/js/controllers/createProfile.js index 3ee1f0a22..92c3569f8 100644 --- a/js/controllers/createProfile.js +++ b/js/controllers/createProfile.js @@ -1,11 +1,12 @@ 'use strict'; -angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, $timeout, notification, pluginManager, identityService, pinService) { +angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, $timeout, notification, pluginManager, identityService, pinService, isMobile) { var _credentials, _firstpin; $scope.init = function() { identityService.goWalletHome(); + $scope.isMobile = isMobile.any(); pinService.makePinInput($scope, 'newpin', function(newValue) { _firstpin = newValue; @@ -88,7 +89,7 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun } else { $scope.error = null; // mobile - if (isMobile.any()) { + if ($scope.isMobile) { _credentials = { email: form.email.$modelValue, password: form.password.$modelValue, diff --git a/js/controllers/home.js b/js/controllers/home.js index 8752fc501..1c08e4514 100644 --- a/js/controllers/home.js +++ b/js/controllers/home.js @@ -6,6 +6,8 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc var _credentials, _firstpin; $scope.init = function() { + $scope.isMobile = isMobile.any(); + // This is only for backwards compat, insight api should link to #!/confirmed directly if (getParam('confirmed')) { var hashIndex = window.location.href.indexOf('/?'); @@ -158,7 +160,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc $scope.confirmedEmail = false; // mobile - if (isMobile.any() && !$rootScope.hasPin) { + if ($scope.isMobile && !$rootScope.hasPin) { $scope.done(); _credentials = { email: email, diff --git a/js/controllers/homeWallet.js b/js/controllers/homeWallet.js index 8d3ec05a1..400cc5329 100644 --- a/js/controllers/homeWallet.js +++ b/js/controllers/homeWallet.js @@ -1,9 +1,16 @@ 'use strict'; -angular.module('copayApp.controllers').controller('HomeWalletController', function($scope, $rootScope, $timeout, $filter, rateService, notification) { +angular.module('copayApp.controllers').controller('HomeWalletController', function($scope, $rootScope, $timeout, $filter, $location, rateService, notification, identityService) { $scope.init = function() { $rootScope.title = 'Home'; + // fix for Safari and mobile devices + var walletId = $location.hash(); + if (walletId) { + $location.hash(''); + identityService.setFocusedWallet(walletId); + } + $scope.rateService = rateService; $scope.isRateAvailable = false; @@ -100,8 +107,6 @@ angular.module('copayApp.controllers').controller('HomeWalletController', functi },1) }, 100); - - $scope.sign = function(ntxid) { var w = $rootScope.wallet; $scope.loading = true; diff --git a/js/controllers/sidebar.js b/js/controllers/sidebar.js index 1a50154ac..e5319c54e 100644 --- a/js/controllers/sidebar.js +++ b/js/controllers/sidebar.js @@ -1,6 +1,8 @@ 'use strict'; -angular.module('copayApp.controllers').controller('SidebarController', function($scope, $rootScope, $location, $timeout, identityService) { +angular.module('copayApp.controllers').controller('SidebarController', function($scope, $rootScope, $location, $timeout, identityService, isMobile) { + + $scope.isMobile = isMobile.any() $scope.menu = [{ 'title': 'Home', @@ -49,7 +51,6 @@ angular.module('copayApp.controllers').controller('SidebarController', function( $scope.setWallets(); }; - $scope.init = function() { // This should be called only once. @@ -61,7 +62,7 @@ angular.module('copayApp.controllers').controller('SidebarController', function( }); } - // wallet list chane + // wallet list change if ($rootScope.iden) { var iden = $rootScope.iden; iden.on('newWallet', function() { @@ -90,8 +91,8 @@ angular.module('copayApp.controllers').controller('SidebarController', function( $scope.setWallets = function() { if (!$rootScope.iden) return; var ret = _.filter($rootScope.iden.listWallets(), function(w) { - return !identityService.isFocused(w.getId()); + return w; }); - $scope.wallets = ret; + $scope.wallets = _.sortBy(ret, 'name'); }; }); diff --git a/js/directives.js b/js/directives.js index 993357694..ca4f76b2d 100644 --- a/js/directives.js +++ b/js/directives.js @@ -280,16 +280,6 @@ angular.module('copayApp.directives') } } ]) - .directive('autoFocus', function($timeout) { - return { - restrict: 'AC', - link: function(_scope, _element) { - $timeout(function() { - _element[0].focus(); - }); - } - }; - }) .directive('showFocus', function($timeout) { return function(scope, element, attrs) { scope.$watch(attrs.showFocus, diff --git a/js/services/balanceService.js b/js/services/balanceService.js index c2be78dcb..31c91ef26 100644 --- a/js/services/balanceService.js +++ b/js/services/balanceService.js @@ -24,7 +24,8 @@ angular.module('copayApp.services') r.availableBalanceBTC = (safeBalanceSat / COIN); r.safeUnspentCount = safeUnspentCount; - r.lockedBalance = (balanceSat - safeBalanceSat) * satToUnit; + var lockedBalance = (balanceSat - safeBalanceSat) * satToUnit; + r.lockedBalance = lockedBalance ? $filter('noFractionNumber')(lockedBalance) : null; r.lockedBalanceBTC = (balanceSat - safeBalanceSat) / COIN; diff --git a/test/unit/services/servicesSpec.js b/test/unit/services/servicesSpec.js index a448187ce..6377c5131 100644 --- a/test/unit/services/servicesSpec.js +++ b/test/unit/services/servicesSpec.js @@ -86,7 +86,7 @@ describe("Angular services", function() { expect(b.totalBalance).to.be.equal('1,000,000.01'); expect(b.availableBalance).to.be.equal('900,000.02'); - expect(b.lockedBalance).to.be.equal(99999.99); + expect(b.lockedBalance).to.be.equal('99,999.99'); expect(b.balanceByAddr[Waddr]).to.equal(2); expect(b.safeUnspentCount).to.equal(5); diff --git a/views/create.html b/views/create.html index bed518cc8..011ff3ccd 100644 --- a/views/create.html +++ b/views/create.html @@ -32,7 +32,7 @@
diff --git a/views/createProfile.html b/views/createProfile.html index dd87c2cef..7d04e7bdd 100644 --- a/views/createProfile.html +++ b/views/createProfile.html @@ -46,7 +46,8 @@ !profileForm.email.$pristine">
- +
diff --git a/views/home.html b/views/home.html index 6a9bb97c3..5cd897e3e 100644 --- a/views/home.html +++ b/views/home.html @@ -110,7 +110,7 @@ + placeholder="Pin number" name="pin" required> @@ -142,7 +142,7 @@

+ name="email" placeholder="Email" required show-focus="!isMobile">
diff --git a/views/homeWallet.html b/views/homeWallet.html index 68994d632..74a12a80f 100644 --- a/views/homeWallet.html +++ b/views/homeWallet.html @@ -9,11 +9,13 @@
-
-
{{$root.wallet.getName() | limitTo: 1}}
-

{{$root.wallet.getName()}}

+
+
+
{{$root.wallet.getName() | limitTo: 1}}
+

{{$root.wallet.getName()}}

+
-
+
diff --git a/views/includes/bottombar-mobile.html b/views/includes/bottombar-mobile.html index 70ea38c4a..5f7f5d2d7 100644 --- a/views/includes/bottombar-mobile.html +++ b/views/includes/bottombar-mobile.html @@ -1,4 +1,4 @@ -
+
diff --git a/views/includes/sidebar-mobile.html b/views/includes/sidebar-mobile.html index afafd2577..f5b59a4f6 100644 --- a/views/includes/sidebar-mobile.html +++ b/views/includes/sidebar-mobile.html @@ -1,78 +1,6 @@ -
-
- - -
- -
-
- + diff --git a/views/includes/sidebar.html b/views/includes/sidebar.html index ec744603f..fc8f808c0 100644 --- a/views/includes/sidebar.html +++ b/views/includes/sidebar.html @@ -1,4 +1,4 @@ -
+
{{$root.wallet.getName() | limitTo: 1}}
@@ -39,7 +39,9 @@ {{'Locked'|translate}}   - {{$root.wallet.balanceInfo.lockedBalance || 0}} {{$root.wallet.settings.unitName}} - {{$root.wallet.balanceInfo.lockedBalanceAlternative}} {{$root.wallet.balanceInfo.alternativeIsoCode}} + + {{$root.wallet.balanceInfo.lockedBalance}} {{$root.wallet.settings.unitName}} + - {{$root.wallet.balanceInfo.lockedBalanceAlternative}} {{$root.wallet.balanceInfo.alternativeIsoCode}}