fix send form

This commit is contained in:
Matias Alejo Garcia 2014-12-30 10:37:04 -03:00
parent ffe1b8e149
commit 6f94825d2d
5 changed files with 13 additions and 9 deletions

View File

@ -4,7 +4,8 @@ angular.module('copayApp.controllers').controller('HomeWalletController', functi
$scope.initHome = function() { $scope.initHome = function() {
$rootScope.title = 'Home'; $rootScope.title = 'Home';
var w = $rootScope.wallet; var w = $rootScope.wallet;
if (w.isShared()) $scope.isShared = w.isShared();
if ($scope.isShared)
$scope.copayers = w.getRegisteredPeerIds(); $scope.copayers = w.getRegisteredPeerIds();
}; };

View File

@ -10,9 +10,11 @@ angular.module('copayApp.controllers').controller('SendController',
$scope.init = function() { $scope.init = function() {
var w = $rootScope.wallet; var w = $rootScope.wallet;
preconditions.checkState(w); preconditions.checkState(w);
preconditions.checkState(w.settings.unitToSatoshi); preconditions.checkState(w.settings.unitToSatoshi);
$rootScope.title = w.isShared() ? 'Send Proposal' : 'Send'; $scope.isShared = w.isShared();
$rootScope.title =$scope.isShared ? 'Send Proposal' : 'Send';
$scope.loading = false; $scope.loading = false;
$scope.error = $scope.success = null; $scope.error = $scope.success = null;
@ -125,7 +127,7 @@ angular.module('copayApp.controllers').controller('SendController',
if (msg.match('expired')) if (msg.match('expired'))
msg = 'The payment request has expired'; msg = 'The payment request has expired';
var message = 'The transaction' + (w.isShared() ? ' proposal' : '') + var message = 'The transaction' + ($scope.isShared ? ' proposal' : '') +
' could not be created: ' + msg; ' could not be created: ' + msg;
$scope.error = message; $scope.error = message;

View File

@ -48,7 +48,7 @@ _.each(levels, function(level, levelName) {
if (Error.stackTraceLimit && this.level == 'debug') { if (Error.stackTraceLimit && this.level == 'debug') {
var old = Error.stackTraceLimit; var old = Error.stackTraceLimit;
Error.stackTraceLimit = 2 Error.stackTraceLimit = 2;
var stack; var stack;
// this hack is to be compatible with IE11 // this hack is to be compatible with IE11

View File

@ -37,8 +37,8 @@
<div class="row "> <div class="row ">
<div class="large-12 columns line-t m10t"> <div class="large-12 columns line-t m10t">
<div class="right size-12"> <div class="right size-12">
<span ng-if="!$root.wallet.isShared()">Personal Wallet</span> <span ng-if="!isShared">Personal Wallet</span>
<span ng-if="$root.wallet.isShared()"> <span ng-if="isShared">
Multisignature wallet [{{$root.wallet.requiredCopayers}} of {{$root.wallet.totalCopayers}} ] Multisignature wallet [{{$root.wallet.requiredCopayers}} of {{$root.wallet.totalCopayers}} ]
</span> </span>
<span ng-if="$root.wallet.isTestnet()"> in TESTNET</span> <span ng-if="$root.wallet.isTestnet()"> in TESTNET</span>
@ -50,7 +50,7 @@
</div> </div>
<div ng-show="$root.wallet.isShared()"> <div ng-show="isShared">
<div class="row"> <div class="row">
<div class="large-12 columns"> <div class="large-12 columns">
<div class="panel oh"> <div class="panel oh">
@ -73,7 +73,7 @@
</div> </div>
</div> </div>
<div class="row" ng-if="$root.wallet.isShared()"> <div class="row" ng-if="isShared">
<!-- List of copayers --> <!-- List of copayers -->
<div class="large-12 columns"> <div class="large-12 columns">
<div class="panel oh"> <div class="panel oh">

View File

@ -131,7 +131,8 @@
<small translate class="has-error" ng-show="sendForm.comment.$invalid && !sendForm.comment.$pristine">too long!</small> <small translate class="has-error" ng-show="sendForm.comment.$invalid && !sendForm.comment.$pristine">too long!</small>
</label> </label>
<div class="input"> <div class="input">
<textarea id="comment" ng-disabled="loading" name="comment" placeholder="{{($root.wallet.isShared() ? 'Leave a private message to your copayers' : 'Add a private comment to identify the transaction')}}" ng-maxlength="100" ng-model="_comment"></textarea> <textarea id="comment" ng-disabled="loading" name="comment" ng-if="isShared" placeholder="Leave a private message to your copayers" ng-maxlength="100" ng-model="_comment"></textarea>
<textarea id="comment" ng-disabled="loading" name="comment" ng-if="!isShared" placeholder="Add a private comment to identify the transaction" ng-maxlength="100" ng-model="_comment"></textarea>
</div> </div>
</div> </div>
</div> </div>