replaced memo modal with input text field

This commit is contained in:
Kadir Sekha 2018-02-08 16:30:47 -04:00
commit 76afbb5a5b
3 changed files with 22 additions and 31 deletions

View file

@ -178,33 +178,25 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
var updateTxDebounced = lodash.debounce(updateTx, 5000);
$scope.showCommentPopup = function() {
var opts = {};
if ($scope.btx.message) {
opts.defaultText = $scope.btx.message;
}
if ($scope.btx.note && $scope.btx.note.body) opts.defaultText = $scope.btx.note.body;
$scope.updateNote = function(text) {
if (typeof text == "undefined") return;
$scope.btx.note = {
body: text
};
popupService.showPrompt($scope.wallet.name, gettextCatalog.getString('Memo'), opts, function(text) {
if (typeof text == "undefined") return;
$log.debug('Saving memo');
$scope.btx.note = {
body: text
};
$log.debug('Saving memo');
var args = {
txid: $scope.btx.txid,
body: text
};
var args = {
txid: $scope.btx.txid,
body: text
};
walletService.editTxNote($scope.wallet, args, function(err, res) {
if (err) {
$log.debug('Could not save tx comment ' + err);
}
});
walletService.editTxNote($scope.wallet, args, function(err, res) {
if (err) {
$log.debug('Could not save tx comment ' + err);
}
});
};
}
$scope.viewOnBlockchain = function() {
var btx = $scope.btx;

View file

@ -58,7 +58,7 @@
}
.info {
span {
display: block;
display: inline-block;
}
.badge {
border-radius: 0;

View file

@ -105,13 +105,12 @@
<time>{{ (btx.ts || btx.createdOn || btx.time) * 1000 | amDateFormat:'MM/DD/YYYY hh:mm a'}}</time>
</span>
</div>
<a class="item item-icon-right" ng-class="{'single-line': !btx.note.body && !btx.message}" ng-click="showCommentPopup()">
<span class="label" translate>Memo</span>
<div class="item-note" style="display: block; float: none; margin-bottom: .25rem;">
{{btx.note.body || btx.message}}
</div>
<i class="icon bp-arrow-right"></i>
</a>
<div class="item single-line">
<span class="label" translate>
Memo: &emsp;
<input style="display:inline-block;" class="label" type="text" placeholder="{{btx.note.body || btx.message || 'Enter text here'}}" ng-model="btx.note.body" ng-blur="updateNote(btx.note.body)"/>
</span>
</div>
<div class="item" ng-if="btx.action != 'received'">
<span class="label" translate>Fee</span>
<span class="m10l">{{btx.feeStr || '...'}}</span>