From ec99639323010375605e3f1ee8fb3a872159a4f1 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Thu, 4 Dec 2014 20:42:08 -0300 Subject: [PATCH] fix auto-focus and isMobile variable --- js/controllers/createProfile.js | 5 +++-- js/controllers/home.js | 4 +++- views/create.html | 2 +- views/createProfile.html | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/js/controllers/createProfile.js b/js/controllers/createProfile.js index 3ee1f0a22..92c3569f8 100644 --- a/js/controllers/createProfile.js +++ b/js/controllers/createProfile.js @@ -1,11 +1,12 @@ 'use strict'; -angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, $timeout, notification, pluginManager, identityService, pinService) { +angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, $timeout, notification, pluginManager, identityService, pinService, isMobile) { var _credentials, _firstpin; $scope.init = function() { identityService.goWalletHome(); + $scope.isMobile = isMobile.any(); pinService.makePinInput($scope, 'newpin', function(newValue) { _firstpin = newValue; @@ -88,7 +89,7 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun } else { $scope.error = null; // mobile - if (isMobile.any()) { + if ($scope.isMobile) { _credentials = { email: form.email.$modelValue, password: form.password.$modelValue, diff --git a/js/controllers/home.js b/js/controllers/home.js index 8752fc501..1c08e4514 100644 --- a/js/controllers/home.js +++ b/js/controllers/home.js @@ -6,6 +6,8 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc var _credentials, _firstpin; $scope.init = function() { + $scope.isMobile = isMobile.any(); + // This is only for backwards compat, insight api should link to #!/confirmed directly if (getParam('confirmed')) { var hashIndex = window.location.href.indexOf('/?'); @@ -158,7 +160,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc $scope.confirmedEmail = false; // mobile - if (isMobile.any() && !$rootScope.hasPin) { + if ($scope.isMobile && !$rootScope.hasPin) { $scope.done(); _credentials = { email: email, diff --git a/views/create.html b/views/create.html index bed518cc8..011ff3ccd 100644 --- a/views/create.html +++ b/views/create.html @@ -32,7 +32,7 @@
diff --git a/views/createProfile.html b/views/createProfile.html index dd87c2cef..7d04e7bdd 100644 --- a/views/createProfile.html +++ b/views/createProfile.html @@ -46,7 +46,8 @@ !profileForm.email.$pristine">
- +