fix menu and sidebar

This commit is contained in:
Matias Alejo Garcia 2015-04-28 20:13:28 -03:00
commit 23f096844f
6 changed files with 23 additions and 21 deletions

View file

@ -7,23 +7,21 @@
<li ng-show="sidebar.wallets[0]"
ng-repeat="item in sidebar.wallets track by $index"
ng-class="{'selected': item.id == index.walletId}"
class="nav-item">
<a ng-click="sidebar.switchWallet(item.id)">
class="nav-item"
ng-click="sidebar.switchWallet(item.id)"
>
<div class="avatar-wallet"
ng-style="{'background-color':item.color}">{{(item.name || item.id) | limitTo: 1}}</div>
<div class="ellipsis name-wallet">{{item.name || item.id}}</div>
<div class="size-12">{{item.m}} <span translate>of</span> {{item.n}}</div>
</a>
</li>
<li>
<a ng-click="$root.go('add')">
<li ng-click="$root.go('add')">
<i class="icon-arrow-right3 size-18 right m10t"></i>
<i class="fi-plus size-24 db left m10r"></i>
<div class="tu text-bold">
<span class="size-12" translate>Add wallet</span>
</div>
<div translate>Create, join or import</div>
</a>
</li>
</ul>
</nav>

View file

@ -322,20 +322,16 @@ a.missing-copayers {
margin-bottom: 30px;
}
.sidebar ul.off-canvas-list li a {
.sidebar ul.off-canvas-list li{
font-size: 12px;
vertical-align: middle;
font-weight: 300;
border-bottom: transparent;
padding: 0;
color: #A5B2BF;
}
.sidebar ul.off-canvas-list li a i {
.sidebar ul.off-canvas-list li i {
vertical-align: middle;
}
.sidebar ul.off-canvas-list li a i {
opacity: 0.6;
}

View file

@ -95,6 +95,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.isComplete = fc.isComplete();
self.txps = [];
self.copayers = [];
self.updateColor();
self.setTab('walletHome', true);
storageService.getBackupFlag(self.walletId, function(err, val) {
self.needsBackup = self.network == 'testnet' ? false : !val;
@ -103,10 +105,17 @@ angular.module('copayApp.controllers').controller('indexController', function($r
});
};
self.setTab = function(tab) {
if (self.tab === tab)
self.setTab = function(tab, reset, tries) {
tries = tries || 0;
if (self.tab === tab && !reset)
return;
if (! document.getElementById('menu-' + tab) && ++tries<5) {
return $timeout(function() {
self.setTab(tab,reset);
}, 300);
}
if (!self.tab)
self.tab = 'walletHome';
@ -257,7 +266,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
};
self.openWallet = function() {
var fc = profileService.focusedClient;
self.updateColor();
$timeout(function() {
$rootScope.$apply();
self.setOngoingProcess('openingWallet', true);
@ -696,8 +704,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.updateTxHistory();
});
$rootScope.$on('Local/SetTab', function(event, tab) {
self.setTab(tab);
$rootScope.$on('Local/SetTab', function(event, tab, reset) {
self.setTab(tab, reset);
});
$rootScope.$on('Local/NeedsPassword', function(event, isSetup, cb) {

View file

@ -21,8 +21,8 @@ angular.module('copayApp.controllers').controller('sidebarController',
self.switchWallet = function(wid) {
self.walletSelection = false;
profileService.setAndStoreFocus(wid, function() {});
go.walletHome();
profileService.setAndStoreFocus(wid, function() {
});
};
self.toggleWalletSelection = function() {

View file

@ -373,7 +373,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
tries = tries || 0;
if (tries > 5) return;
var e = document.getElementById('menu-walletHome');
if (!e) $timeout(function() {
if (!e) return $timeout(function() {
self.bindTouchDown(++tries);
}, 500);

View file

@ -55,7 +55,7 @@ angular.module('copayApp.services').factory('go', function($window, $rootScope,
root.path('copayers');
} else {
root.path('walletHome', function() {
$rootScope.$emit('Local/SetTab', 'walletHome');
$rootScope.$emit('Local/SetTab', 'walletHome', true);
});
}
};