Fix add wallet form for wp8

This commit is contained in:
Gustavo Maximiliano Cortez 2015-04-14 16:20:12 -03:00
commit f49c3e98ab
3 changed files with 21 additions and 8 deletions

View file

@ -13,17 +13,17 @@
</div> </div>
<div class="row"> <div class="row">
<div class="large-12 columns"> <div class="large-12 columns" ng-hide="create.hideWalletName">
<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" name="walletName" ng-model="walletName" ng-required="true"> <input type="text" placeholder="{{'Family vacation funds'|translate}}" class="form-control" name="walletName" ng-model="walletName" ng-required="true" ng-blur="create.formFocus(false)">
</div> </div>
</label> </label>
</div> </div>
<div class="large-12 columns" ng-show="totalCopayers != 1" > <div class="large-12 columns" ng-show="totalCopayers != 1">
<label><span translate>Your nickname</span> <label><span translate>Your nickname</span>
<div class="input"> <div class="input">
<input type="text" placeholder="{{'John'|translate}}" class="form-control" name="myName" ng-model="myName" ng-required="totalCopayers != 1" ng-disabled="totalCopayers == 1"> <input type="text" placeholder="{{'John'|translate}}" class="form-control" name="myName" ng-model="myName" ng-required="totalCopayers != 1" ng-disabled="totalCopayers == 1" ng-focus="create.formFocus('my-name')" ng-blur="create.formFocus(false)">
</div> </div>
</label> </label>
</div> </div>

View file

@ -1,10 +1,11 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('createController', angular.module('copayApp.controllers').controller('createController',
function($scope, $rootScope, $location, $timeout, $log, lodash, go, profileService, configService, isCordova) { function($scope, $rootScope, $location, $timeout, $log, lodash, go, profileService, configService, isMobile, isCordova) {
var self = this; var self = this;
var defaults = configService.getDefaults(); var defaults = configService.getDefaults();
this.isWindowsPhoneApp = isMobile.Windows() && isCordova;
/* For compressed keys, m*73 + n*34 <= 496 */ /* For compressed keys, m*73 + n*34 <= 496 */
var COPAYER_PAIR_LIMITS = { var COPAYER_PAIR_LIMITS = {
@ -68,6 +69,20 @@ angular.module('copayApp.controllers').controller('createController',
}); });
}, 100); }, 100);
}; };
this.formFocus = function(what) {
if (!this.isWindowsPhoneApp) return
if (what && what == 'my-name') {
this.hideWalletName = true;
}
else {
this.hideWalletName = false;
}
$timeout(function() {
$rootScope.$digest();
}, 1);
};
$scope.$on("$destroy", function() { $scope.$on("$destroy", function() {
$rootScope.hideWalletNavigation = false; $rootScope.hideWalletNavigation = false;

View file

@ -55,12 +55,10 @@ angular.module('copayApp.controllers').controller('sendController',
if (!this.isWindowsPhoneApp) return if (!this.isWindowsPhoneApp) return
if (!what) { if (!what) {
$rootScope.wpInputFocused = false;
this.hideAddress = false; this.hideAddress = false;
this.hideAmount = false; this.hideAmount = false;
} else { } else {
$rootScope.wpInputFocused = true;
if (what == 'amount') { if (what == 'amount') {
this.hideAddress = true; this.hideAddress = true;
} else if (what == 'msg') { } else if (what == 'msg') {