Merge pull request #2516 from cmgustavo/bug/wp8-13

Bug/wp8 13
This commit is contained in:
Matias Alejo Garcia 2015-04-15 13:38:40 -03:00
commit 5581f8184f
4 changed files with 25 additions and 12 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

@ -67,7 +67,7 @@
</div> </div>
<div class="input"> <div class="input">
<input type="text" id="address" name="address" ng-disabled="send.blockUx || send.lockAddress" ng-attr-placeholder="{{'Bitcoin address'|translate}}" ng-model="_address" valid-address required ng-blur="send.formFocus(false)"> <input type="text" id="address" name="address" ng-disabled="send.blockUx || send.lockAddress" ng-attr-placeholder="{{'Bitcoin address'|translate}}" ng-model="_address" valid-address required ng-focus="send.formFocus('address')" ng-blur="send.formFocus(false)">
</div> </div>
</div> </div>
<div ng-show="send._paypro && !send.hideAddress"> <div ng-show="send._paypro && !send.hideAddress">
@ -102,7 +102,7 @@
</label> </label>
<div class="input"> <div class="input">
<input type="number" id="amount" ng-disabled="send.blockUx || send.lockAmount" name="amount" ng-attr-placeholder="{{'Amount'|translate}}" ng-minlength="0.00000001" ng-maxlength="10000000000" ng-model="_amount" valid-amount required autocomplete="off" ng-blur="send.formFocus(false)"> <input type="number" id="amount" ng-disabled="send.blockUx || send.lockAmount" name="amount" ng-attr-placeholder="{{'Amount'|translate}}" ng-minlength="0.00000001" ng-maxlength="10000000000" ng-model="_amount" valid-amount required autocomplete="off" ng-focus="send.formFocus('amount')" ng-blur="send.formFocus(false)">
<a class="postfix" ng-click="showAlternative = true">{{send.unitName}}</a> <a class="postfix" ng-click="showAlternative = true">{{send.unitName}}</a>
</div> </div>
</div> </div>
@ -110,7 +110,7 @@
<label for="alternative"><span translate>Amount in</span> {{ send.alternativeName }} <label for="alternative"><span translate>Amount in</span> {{ send.alternativeName }}
</label> </label>
<div class="input"> <div class="input">
<input type="number" id="alternative" ng-disabled="send.blockUx || !send.isRateAvailable || send.lockAmount" name="alternative" ng-attr-placeholder="{{'Amount'|translate}}" ng-model="_alternative" requiredautocomplete="off" ng-blur="send.formFocus(false)"> <input type="number" id="alternative" ng-disabled="send.blockUx || !send.isRateAvailable || send.lockAmount" name="alternative" ng-attr-placeholder="{{'Amount'|translate}}" ng-model="_alternative" requiredautocomplete="off" ng-focus="send.formFocus('amount')" ng-blur="send.formFocus(false)">
<a class="postfix" ng-click="showAlternative = false"> {{ send.alternativeIsoCode }}</a> <a class="postfix" ng-click="showAlternative = false"> {{ send.alternativeIsoCode }}</a>
</div> </div>
</div> </div>
@ -124,7 +124,7 @@
</label> </label>
<div class="input"> <div class="input">
<textarea id="comment" ng-disabled="send.blockUx" name="comment" <textarea id="comment" ng-disabled="send.blockUx" name="comment"
ng-maxlength="100" ng-model="_comment" ng-maxlength="100" ng-model="_comment" ng-focus="send.formFocus('msg')"
ng-blur="send.formFocus(false)"></textarea> ng-blur="send.formFocus(false)"></textarea>
</div> </div>
</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') {