wallet-bar for small devices

This commit is contained in:
Gustavo Maximiliano Cortez 2014-12-04 20:43:27 -03:00
parent 5be9fbc47c
commit 244ea456c6
7 changed files with 39 additions and 36 deletions

View File

@ -58,12 +58,6 @@
text-align: center; text-align: center;
} }
header h1.left-sidebar {
margin: 5px 10px;
text-align: left;
font-size: 16px;
}
.col3 a { .col3 a {
height: 45px; height: 45px;
padding: 12px 5px; padding: 12px 5px;
@ -233,8 +227,8 @@
border-bottom: none; border-bottom: none;
} }
.photo-container { .side-nav li.nav-item.selected {
margin-right: 5px; background-color: #3C4E60;
} }
} }

View File

@ -1,9 +1,16 @@
'use strict'; '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() { $scope.init = function() {
$rootScope.title = 'Home'; $rootScope.title = 'Home';
// fix for Safari and mobile devices
var walletId = $location.hash();
if (walletId) {
$location.hash('');
identityService.setFocusedWallet(walletId);
}
$scope.rateService = rateService; $scope.rateService = rateService;
$scope.isRateAvailable = false; $scope.isRateAvailable = false;
@ -100,8 +107,6 @@ angular.module('copayApp.controllers').controller('HomeWalletController', functi
},1) },1)
}, 100); }, 100);
$scope.sign = function(ntxid) { $scope.sign = function(ntxid) {
var w = $rootScope.wallet; var w = $rootScope.wallet;
$scope.loading = true; $scope.loading = true;

View File

@ -1,6 +1,8 @@
'use strict'; '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 = [{ $scope.menu = [{
'title': 'Home', 'title': 'Home',
@ -49,7 +51,6 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
$scope.setWallets(); $scope.setWallets();
}; };
$scope.init = function() { $scope.init = function() {
// This should be called only once. // This should be called only once.
@ -90,8 +91,8 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
$scope.setWallets = function() { $scope.setWallets = function() {
if (!$rootScope.iden) return; if (!$rootScope.iden) return;
var ret = _.filter($rootScope.iden.listWallets(), function(w) { var ret = _.filter($rootScope.iden.listWallets(), function(w) {
return !identityService.isFocused(w.getId()); return w;
}); });
$scope.wallets = ret; $scope.wallets = _.sortBy(ret, 'name');
}; };
}); });

View File

@ -1,4 +1,4 @@
<div class="row collapse" ng-controller="SidebarController"> <div class="row collapse">
<div class="medium-3 small-3 columns text-center bottombar-item" ng-repeat="item in menu" ui-route="{{item.link}}" ng-if="item.link!='more'"> <div class="medium-3 small-3 columns text-center bottombar-item" ng-repeat="item in menu" ui-route="{{item.link}}" ng-if="item.link!='more'">
<a ng-click="go(item.link)" ng-class="{active: isActive(item)}"> <a ng-click="go(item.link)" ng-class="{active: isActive(item)}">
<i class="size-36 {{item.icon}} db"></i> <i class="size-36 {{item.icon}} db"></i>

View File

@ -1,18 +1,16 @@
<div ng-controller="SidebarController" ng-init="username = $root.iden.getName()"> <div ng-init="username = $root.iden.getName()">
<header> <div class="text-center off-canvas-list">
<h1 class="left-sidebar"> <a href="#!/profile" class="columns m10v" title="Profile">
<span class="photo-container m20r"> <div class="photo-container">
<img gravatar-src="'{{username}}'" gravatar-size="35"> <img gravatar-src="'{{username}}'" gravatar-size="35">
</div>
<p class="text-black m5">{{username}}</p>
<span class="db text-gray size-10" >
<i class="fi-torso"></i> {{'ViewProfile' | translate }}
</span> </span>
<span class="m5t">{{username}}</span>
</h1>
</header>
<ul class="off-canvas-list">
<li>
<a href="#!/profile" class="db p20h nav-item" title="Profile">
<i class="size-24 m20r fi-torso"></i> {{'My profile' | translate }}
</a> </a>
</li> </div>
<ul class="off-canvas-list">
<li> <li>
<a href="#!/create" class="db p20h nav-item" title="Create new wallet"> <a href="#!/create" class="db p20h nav-item" title="Create new wallet">
<i class="size-24 m20r fi-plus"></i> {{'Create new wallet' | translate }} </a> <i class="size-24 m20r fi-plus"></i> {{'Create new wallet' | translate }} </a>

View File

@ -1,4 +1,4 @@
<div ng-controller="SidebarController" ng-init="init()"> <div>
<header ng-show="$root.wallet"> <header ng-show="$root.wallet">
<div class="col1"> <div class="col1">
<div class="avatar-wallet">{{$root.wallet.getName() | limitTo: 1}}</div> <div class="avatar-wallet">{{$root.wallet.getName() | limitTo: 1}}</div>
@ -53,7 +53,11 @@
<div> <div>
<ul class="side-nav wallets" ng-class="{'pullDown': walletSelection}" ng-show="wallets[0]"> <ul class="side-nav wallets" ng-class="{'pullDown': walletSelection}" ng-show="wallets[0]">
<li data-ng-repeat="item in wallets track by $index" class="nav-item" ng-if="item.id != $root.wallet.id" ng-click="switchWallet(item.id)"> <li
ng-repeat="item in wallets track by $index"
class="nav-item"
ng-if="item.id != $root.wallet.id"
ng-click="switchWallet(item.id)">
<div class="col1"> <div class="col1">
<div class="avatar-wallet">{{(item.name || item.id) | limitTo: 1}}</div> <div class="avatar-wallet">{{(item.name || item.id) | limitTo: 1}}</div>
</div> </div>

View File

@ -1,5 +1,5 @@
<div ng-controller="SidebarController" ng-init="init()"> <div>
<header> <header ng-show="$root.wallet">
<h1>My wallets</h1> <h1>My wallets</h1>
</header> </header>
<div class="side-nav text-center off-canvas-list" ng-show="!wallets[0]"> <div class="side-nav text-center off-canvas-list" ng-show="!wallets[0]">
@ -8,14 +8,15 @@
<i class="m10r fi-plus"></i> {{'Create new wallet' | translate }} </a> <i class="m10r fi-plus"></i> {{'Create new wallet' | translate }} </a>
</div> </div>
<ul class="side-nav wallets off-canvas-list" ng-show="wallets[0]"> <ul class="side-nav wallets off-canvas-list" ng-show="wallets[0]">
<li data-ng-repeat="item in wallets track by $index" <li
class="nav-item" ng-repeat="item in wallets track by $index"
ng-click="switchWallet(item.id)"> ng-class="{'selected': item.id == $root.wallet.id}"
class="nav-item">
<div class="col1"> <div class="col1">
<div class="avatar-wallet">{{(item.name || item.id) | limitTo: 1}}</div> <div class="avatar-wallet">{{(item.name || item.id) | limitTo: 1}}</div>
</div> </div>
<div class="col2"> <div class="col2">
<a href class="size-12 wallet-item"> <a href="#!/homeWallet#{{item.id}}" class="size-12 wallet-item">
<div class="oh"> <div class="oh">
<div class="right size-10 type-wallet"> <div class="right size-10 type-wallet">
[ {{item.requiredCopayers}} of {{item.totalCopayers}} ]</div> [ {{item.requiredCopayers}} of {{item.totalCopayers}} ]</div>