fix auto-focus and isMobile variable

This commit is contained in:
Gustavo Maximiliano Cortez 2014-12-04 20:42:08 -03:00
parent 2af28f0f1d
commit ec99639323
4 changed files with 9 additions and 5 deletions

View File

@ -1,11 +1,12 @@
'use strict'; '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; var _credentials, _firstpin;
$scope.init = function() { $scope.init = function() {
identityService.goWalletHome(); identityService.goWalletHome();
$scope.isMobile = isMobile.any();
pinService.makePinInput($scope, 'newpin', function(newValue) { pinService.makePinInput($scope, 'newpin', function(newValue) {
_firstpin = newValue; _firstpin = newValue;
@ -88,7 +89,7 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
} else { } else {
$scope.error = null; $scope.error = null;
// mobile // mobile
if (isMobile.any()) { if ($scope.isMobile) {
_credentials = { _credentials = {
email: form.email.$modelValue, email: form.email.$modelValue,
password: form.password.$modelValue, password: form.password.$modelValue,

View File

@ -6,6 +6,8 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
var _credentials, _firstpin; var _credentials, _firstpin;
$scope.init = function() { $scope.init = function() {
$scope.isMobile = isMobile.any();
// This is only for backwards compat, insight api should link to #!/confirmed directly // This is only for backwards compat, insight api should link to #!/confirmed directly
if (getParam('confirmed')) { if (getParam('confirmed')) {
var hashIndex = window.location.href.indexOf('/?'); var hashIndex = window.location.href.indexOf('/?');
@ -158,7 +160,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
$scope.confirmedEmail = false; $scope.confirmedEmail = false;
// mobile // mobile
if (isMobile.any() && !$rootScope.hasPin) { if ($scope.isMobile && !$rootScope.hasPin) {
$scope.done(); $scope.done();
_credentials = { _credentials = {
email: email, email: email,

View File

@ -32,7 +32,7 @@
<div class="panel"> <div class="panel">
<label><span translate>Wallet name</span> <label><span translate>Wallet name</span>
<div class="input"> <div class="input">
<input type="text" placeholder="{{'Family vacation funds'|translate}}" class="form-control" ng-model="walletName" auto-focus> <input type="text" placeholder="{{'Family vacation funds'|translate}}" class="form-control" ng-model="walletName">
<i class="icon-wallet"></i> <i class="icon-wallet"></i>
</div> </div>
</label> </label>

View File

@ -46,7 +46,8 @@
!profileForm.email.$pristine"><i class="fi-check"></i></span> !profileForm.email.$pristine"><i class="fi-check"></i></span>
</div> </div>
<div class="input"> <div class="input">
<input type="email" ng-model="email" class="form-control fi-email" name="email" placeholder="Email" required auto-focus> <input type="email" ng-model="email" class="form-control fi-email" name="email" placeholder="Email"
show-focus="!isMobile" required>
<i class="icon-email"></i> <i class="icon-email"></i>
</div> </div>