Fix add wallet form for wp8

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

View File

@ -13,17 +13,17 @@
</div>
<div class="row">
<div class="large-12 columns">
<div class="large-12 columns" ng-hide="create.hideWalletName">
<label><span translate>Wallet name</span>
<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>
</label>
</div>
<div class="large-12 columns" ng-show="totalCopayers != 1" >
</div>
<div class="large-12 columns" ng-show="totalCopayers != 1">
<label><span translate>Your nickname</span>
<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>
</label>
</div>

View File

@ -1,10 +1,11 @@
'use strict';
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 defaults = configService.getDefaults();
this.isWindowsPhoneApp = isMobile.Windows() && isCordova;
/* For compressed keys, m*73 + n*34 <= 496 */
var COPAYER_PAIR_LIMITS = {
@ -68,6 +69,20 @@ angular.module('copayApp.controllers').controller('createController',
});
}, 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() {
$rootScope.hideWalletNavigation = false;

View File

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