save memo correctly

This commit is contained in:
Javier 2016-09-21 14:55:56 -03:00
commit 60a7f0c287
3 changed files with 7 additions and 3 deletions

View file

@ -141,7 +141,6 @@
<div class="item item-icon-right" ng-click="showCommentPopup()"> <div class="item item-icon-right" ng-click="showCommentPopup()">
<span class="text-gray" translate ng-show="!btx.note">Add Memo</i></span> <span class="text-gray" translate ng-show="!btx.note">Add Memo</i></span>
<span class="text-gray" translate ng-show="btx.note">Memo</span> <span class="text-gray" translate ng-show="btx.note">Memo</span>
<i class="icon nav-item-arrow-right"></i>
<div ng-show="btx.note && btx.note.body"> <div ng-show="btx.note && btx.note.body">
<span class="enable_text_select">{{btx.note.body}}</span><br> <span class="enable_text_select">{{btx.note.body}}</span><br>
<span class="text-italic item-note size-12"> <span class="text-italic item-note size-12">

View file

@ -81,7 +81,12 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
}; };
$scope.showCommentPopup = function() { $scope.showCommentPopup = function() {
popupService.showPrompt(gettextCatalog.getString('Memo'), ' ', {}, function(text) { var opts = {};
if ($scope.btx.note && $scope.btx.note.body) opts.defaultText = $scope.btx.note.body;
popupService.showPrompt(null, gettextCatalog.getString('Memo'), opts, function(text) {
if (typeof text == "undefined") return;
$log.debug('Saving memo'); $log.debug('Saving memo');
var args = { var args = {

View file

@ -37,7 +37,7 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni
inputPlaceholder: opts.inputPlaceholder, inputPlaceholder: opts.inputPlaceholder,
defaultText: opts.defaultText defaultText: opts.defaultText
}).then(function(res) { }).then(function(res) {
return cb(res) return cb(res);
}); });
}; };