diff --git a/www/js/controllers/transfer-controllers.js b/www/js/controllers/transfer-controllers.js index c881bd3093e4b6973fe55432e5e1e3144bfabd58..dc4a2b6545e9552239076e66dd24fef1cbbed65e 100644 --- a/www/js/controllers/transfer-controllers.js +++ b/www/js/controllers/transfer-controllers.js @@ -69,10 +69,13 @@ function TransferController($scope, $controller, UIUtils, csWot, csWallet) { if (state.stateParams.comment) { parameters.comment = state.stateParams.comment; } + if (state.stateParams.restPub) { + parameters.restPub = state.stateParams.restPub; + } } // Make sure wallet is loaded - csWallet.login({sources: true}) + return csWallet.login({sources: true}) // If pubkey, get the uid (+ name, avatar) .then(function(data) { @@ -119,7 +122,8 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc amount: null, comment: null, useRelative: csSettings.data.useRelative, - useComment: false + useComment: false, + restPub: null }; $scope.udAmount = null; $scope.minAmount = minQuantitativeAmount; @@ -167,6 +171,9 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc $scope.formData.useComment=true; $scope.formData.comment = parameters.comment; } + if (parameters.restPub) { + $scope.formData.restPub = parameters.restPub; + } }; // Read default parameters $scope.setParameters(parameters); diff --git a/www/templates/wallet/transfer_form.html b/www/templates/wallet/transfer_form.html index fb01757fb0b11b2fee7a4abff5367df78f0e27f3..4a9666afe9549afa0ddfe791f3c8e9667a881983 100644 --- a/www/templates/wallet/transfer_form.html +++ b/www/templates/wallet/transfer_form.html @@ -118,13 +118,14 @@ id="{{commentInputId}}" name="comment" ng-model="formData.comment" + ng-model-options="{ debounce: 650 }" ng-maxlength="255" ng-pattern="commentPattern" ng-focus="hideDigitKeyboard()"> </textarea> </label> <div class="form-errors" - ng-show="form.$submitted && form.comment.$error" + ng-show="form.comment.$error" ng-messages="form.comment.$error"> <div class="form-error" ng-message="maxlength"> <span translate="ERROR.FIELD_TOO_LONG"></span> @@ -135,18 +136,18 @@ </div> <!-- Warn comment is public --> - <div class="item item-icon-left item-text-wrap hidden-xs hidden-sm"> - <i class="icon ion-ios-information-outline positive"></i> - <h4 class="positive" translate>TRANSFER.WARN_COMMENT_IS_PUBLIC</h4> + <div class="item item-icon-left item-text-wrap item-no-border hidden-xs hidden-sm"> + <div class=" animate-fade-in animate-show-hide ng-hide" ng-show="formData.comment && formData.comment.length || form.comment.$invalid"> + <i class="icon ion-android-alert positive"></i> + <h4 class="positive" translate>TRANSFER.WARN_COMMENT_IS_PUBLIC</h4> + </div> </div> - <div class="item item-icon-left item-text-wrap visible-xs visible-sm" ng-if="formData.useComment"> - <i class="icon ion-ios-information-outline positive"></i> + <div class="item item-icon-left item-text-wrap item-no-border visible-xs visible-sm" ng-if="formData.useComment"> + <i class="icon ion-android-alert positive"></i> <h4 class="positive" translate>TRANSFER.WARN_COMMENT_IS_PUBLIC</h4> </div> </div> - - <div class="padding hidden-xs text-right"> <button class="button button-clear button-dark ink" ng-click="cancel()" type="button" translate>COMMON.BTN_CANCEL