diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 2a3b1df4f..d2b241eda 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -121,8 +121,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r if (document.getElementById(tab)) { document.getElementById(tab).className = 'tab-in tab-view ' + tab; var newe = document.getElementById('menu-' + tab); - newe.className = 'active'; - newe.style.borderTopColor = self.backgroundColor; + if (newe) { + newe.className = 'active'; + newe.style.borderTopColor = self.backgroundColor; + } } self.tab = tab; diff --git a/src/js/init.js b/src/js/init.js index 0b3f01085..21cd08a5e 100644 --- a/src/js/init.js +++ b/src/js/init.js @@ -9,13 +9,6 @@ angular.element(document).ready(function() { /* Cordova specific Init */ if (window.cordova !== undefined) { - // Fastclick event - if ('addEventListener' in document) { - document.addEventListener('DOMContentLoaded', function() { - FastClick.attach(document.body); - }, false); - } - document.addEventListener('deviceready', function() { document.addEventListener('pause', function() { diff --git a/src/js/routes.js b/src/js/routes.js index b8122ac63..7b162f30e 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -376,6 +376,10 @@ angular }); }) .run(function($rootScope, $state, $log, gettextCatalog, uriHandler, isCordova, amMoment, profileService) { + + console.log('Attaching FastClick'); + FastClick.attach(document.body); + // Auto-detect browser language var userLang, androidLang;