Merge pull request #195 from cmgustavo/ref/design-54

Hide ion-tabs on amount/confirm and addressbook views
This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-27 10:02:12 -03:00 committed by GitHub
commit 5955041547
5 changed files with 31 additions and 10 deletions

View File

@ -3,13 +3,13 @@ Create tabs with an icon and label, using the tabs-positive style.
Each tab's child <ion-nav-view> directive will have its own
navigation history that also transitions its views in and out.
-->
<ion-tabs class="tabs-icon-top tabs-color-active-positive" ng-controller="tabsController">
<ion-tabs class="tabs-icon-top tabs-color-active-positive" ng-class="{'tabs-item-hide': hideTabs}">
<ion-tab title="Home" icon-off="ico-home" icon-on="ico-home-selected" href="#/tabs/home">
<ion-tab title="Home" icon-off="ico-home" icon-on="ico-home-selected" ui-sref="tabs.home">
<ion-nav-view name="tab-home"></ion-nav-view>
</ion-tab>
<ion-tab title="Receive" icon-off="ico-receive" icon-on="ico-receive-selected" href="#/tabs/receive">
<ion-tab title="Receive" icon-off="ico-receive" icon-on="ico-receive-selected" ui-sref="tabs.receive">
<ion-nav-view name="tab-receive"></ion-nav-view>
</ion-tab>
@ -21,7 +21,7 @@ navigation history that also transitions its views in and out.
<ion-tab title="Scan" icon-off="ico-scan" ng-click="scan()" >
</ion-tab>
<ion-tab title="Send" icon-off="ico-send" icon-on="ico-send-selected" href="#/tabs/send">
<ion-tab title="Send" icon-off="ico-send" icon-on="ico-send-selected" ui-sref="tabs.send">
<ion-nav-view name="tab-send"></ion-nav-view>
</ion-tab>

View File

@ -15,11 +15,11 @@ angular.module('copayApp.controllers').controller('amountController', function($
$scope.toName = $stateParams.toName;
$scope.toEmail = $stateParams.toEmail;
$scope.$on('$ionicView.beforeLeave', function() {
$scope.$on('$ionicView.leave', function() {
angular.element($window).off('keydown');
});
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.$on("$ionicView.enter", function(event, data) {
if (!$stateParams.toAddress) {
$log.error('Bad params at amount')

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('tabsController', function($log, $scope, $stateParams, $ionicModal, $timeout, incomingData) {
angular.module('copayApp.controllers').controller('tabsController', function($rootScope, $log, $scope, $state, $stateParams, $timeout, incomingData, lodash) {
$scope.onScan = function(data) {
if (!incomingData.redir(data)) {
@ -22,6 +22,28 @@ angular.module('copayApp.controllers').controller('tabsController', function($lo
$timeout(function() {
$scope.$apply();
}, 1);
}
};
var hideTabsViews = [
'tabs.send.amount',
'tabs.send.confirm',
'tabs.send.addressbook',
'tabs.addressbook',
'tabs.addressbook.add',
'tabs.addressbook.view',
];
$rootScope.$on('$ionicView.beforeEnter', function() {
$rootScope.hideTabs = false;
var currentState = $state.current.name;
lodash.each(hideTabsViews, function(view) {
if (currentState === view) {
$rootScope.hideTabs = true;
}
});
});
});

View File

@ -191,6 +191,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs', {
url: '/tabs',
abstract: true,
controller: 'tabsController',
templateUrl: 'views/tabs.html'
})
.state('tabs.home', {

View File

@ -15,8 +15,6 @@
.item {
color: #444;
border-top: none;
padding-top: 1.5rem;
padding-bottom: 1.5rem;
&:before {
display: block;
position: absolute;