diff --git a/src/js/controllers/tabsController.js b/src/js/controllers/tabsController.js index 642948ab6..13c14cde8 100644 --- a/src/js/controllers/tabsController.js +++ b/src/js/controllers/tabsController.js @@ -6,7 +6,7 @@ angular.module('copayApp.controllers').controller('tabsController', function($ro if (!incomingData.redir(data)) { popupService.showAlert(null, gettextCatalog.getString('Invalid data')); } - } + }; $scope.setScanFn = function(scanFn) { $scope.scan = function() { @@ -22,33 +22,4 @@ angular.module('copayApp.controllers').controller('tabsController', function($ro }, 1); }; - var hideTabsViews = [ - 'tabs.send.amount', - 'tabs.send.confirm', - 'tabs.send.addressbook', - 'tabs.addressbook', - 'tabs.addressbook.add', - 'tabs.addressbook.view', - 'tabs.preferences.backupWarning', - 'tabs.preferences.backup', - 'tabs.receive.backupWarning', - 'tabs.receive.backup', - 'tabs.bitpayCard.amount', - 'tabs.bitpayCard.confirm', - 'tabs.bitpayCardIntro' - ]; - - $rootScope.$on('$ionicView.beforeEnter', function() { - - $rootScope.hideTabs = false; - - var currentState = $state.current.name; - - lodash.each(hideTabsViews, function(view) { - if (currentState === view) { - $rootScope.hideTabs = true; - } - }); - }); - }); diff --git a/src/js/directives/hideTabs.js b/src/js/directives/hideTabs.js new file mode 100644 index 000000000..c5d933df7 --- /dev/null +++ b/src/js/directives/hideTabs.js @@ -0,0 +1,13 @@ +'use strict'; +angular.module('copayApp.directives') +.directive('hideTabs', function($rootScope) { + return { + restrict: 'A', + link: function($scope, $el) { + $rootScope.hideTabs = 'tabs-item-hide'; + $scope.$on('$destroy', function() { + $rootScope.hideTabs = ''; + }); + } + }; +}); diff --git a/www/views/addressbook.add.html b/www/views/addressbook.add.html index f285f53b2..afbb48099 100644 --- a/www/views/addressbook.add.html +++ b/www/views/addressbook.add.html @@ -1,4 +1,4 @@ - + Add Contact diff --git a/www/views/addressbook.html b/www/views/addressbook.html index 19b32979c..1ed714ed4 100644 --- a/www/views/addressbook.html +++ b/www/views/addressbook.html @@ -1,4 +1,4 @@ - + diff --git a/www/views/addressbook.view.html b/www/views/addressbook.view.html index 5089a66a3..46b759de5 100644 --- a/www/views/addressbook.view.html +++ b/www/views/addressbook.view.html @@ -1,4 +1,4 @@ - + diff --git a/www/views/amount.html b/www/views/amount.html index ab7bd4325..29dd08a5d 100644 --- a/www/views/amount.html +++ b/www/views/amount.html @@ -1,4 +1,4 @@ - + {{'Enter Amount'|translate}} diff --git a/www/views/backup.html b/www/views/backup.html index 5f106182e..d93429161 100644 --- a/www/views/backup.html +++ b/www/views/backup.html @@ -1,4 +1,4 @@ - + {{viewTitle}} diff --git a/www/views/backupWarning.html b/www/views/backupWarning.html index 6af1592fc..f824c67d6 100644 --- a/www/views/backupWarning.html +++ b/www/views/backupWarning.html @@ -1,4 +1,4 @@ - +