mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #195 from cmgustavo/ref/design-54
Hide ion-tabs on amount/confirm and addressbook views
This commit is contained in:
commit
5955041547
|
@ -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>
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -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', {
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
.item {
|
||||
color: #444;
|
||||
border-top: none;
|
||||
padding-top: 1.5rem;
|
||||
padding-bottom: 1.5rem;
|
||||
&:before {
|
||||
display: block;
|
||||
position: absolute;
|
||||
|
|
Loading…
Reference in New Issue