replace comment
This commit is contained in:
parent
574d29777d
commit
b3bf13918d
3 changed files with 21 additions and 35 deletions
|
|
@ -128,19 +128,17 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item" ng-show="btx.note && btx.note.body">
|
|
||||||
<div translate>Comment</div>
|
|
||||||
<span class="enable_text_select">{{btx.note.body}}</span><br>
|
|
||||||
<span class="text-italic item-note size-12">
|
|
||||||
<span translate>Edited by</span> <span>{{btx.note.editedByName}}</span>,
|
|
||||||
<time>{{btx.note.editedOn * 1000 | amTimeAgo}}</time></span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<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">Edit Memo</span>
|
<span class="text-gray" translate ng-show="btx.note">Memo</span>
|
||||||
<i class="icon nav-item-arrow-right"></i>
|
<i class="icon nav-item-arrow-right"></i>
|
||||||
|
<div ng-show="btx.note && btx.note.body">
|
||||||
|
<span class="enable_text_select">{{btx.note.body}}</span><br>
|
||||||
|
<span class="text-italic item-note size-12">
|
||||||
|
<span translate>Edited by</span> <span>{{btx.note.editedByName}}</span>,
|
||||||
|
<time>{{btx.note.editedOn * 1000 | amTimeAgo}}</time></span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item item-divider" ng-show="btx.action == 'sent'" translate>Timeline</div>
|
<div class="item item-divider" ng-show="btx.action == 'sent'" translate>Timeline</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('txDetailsController', function($rootScope, $log, $scope, $filter, $stateParams, $ionicPopup, gettextCatalog, profileService, configService, lodash, txFormatService, platformInfo, externalLinkService) {
|
angular.module('copayApp.controllers').controller('txDetailsController', function($rootScope, $log, $timeout, $scope, $filter, $stateParams, $ionicPopup, gettextCatalog, profileService, configService, lodash, txFormatService, platformInfo, externalLinkService, popupService) {
|
||||||
|
|
||||||
var self = $scope.self;
|
var self = $scope.self;
|
||||||
var wallet = profileService.getWallet($stateParams.walletId);
|
var wallet = profileService.getWallet($stateParams.walletId);
|
||||||
|
|
@ -24,27 +24,12 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.showCommentPopup = function() {
|
$scope.showCommentPopup = function() {
|
||||||
$scope.data = {
|
popupService.showPrompt(gettextCatalog.getString('Memo'), null, null, function(res) {
|
||||||
comment: $scope.btx.note ? $scope.btx.note.body : '',
|
$log.debug('Saving memo');
|
||||||
};
|
|
||||||
|
|
||||||
var commentPopup = $ionicPopup.show({
|
|
||||||
templateUrl: "views/includes/note.html",
|
|
||||||
scope: $scope,
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.commentPopupClose = function() {
|
|
||||||
commentPopup.close();
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.commentPopupSave = function() {
|
|
||||||
$log.debug('Saving note');
|
|
||||||
var args = {
|
var args = {
|
||||||
txid: $scope.btx.txid,
|
txid: $scope.btx.txid,
|
||||||
};
|
body: res
|
||||||
|
|
||||||
if ($scope.data.comment) {
|
|
||||||
args.body = $scope.data.comment;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
wallet.editTxNote(args, function(err) {
|
wallet.editTxNote(args, function(err) {
|
||||||
|
|
@ -56,14 +41,17 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
|
||||||
$scope.btx.note = null;
|
$scope.btx.note = null;
|
||||||
if (args.body) {
|
if (args.body) {
|
||||||
$scope.btx.note = {};
|
$scope.btx.note = {};
|
||||||
$scope.btx.note.body = $scope.data.comment;
|
$scope.btx.note.body = res;
|
||||||
$scope.btx.note.editedByName = wallet.credentials.copayerName;
|
$scope.btx.note.editedByName = wallet.credentials.copayerName;
|
||||||
$scope.btx.note.editedOn = Math.floor(Date.now() / 1000);
|
$scope.btx.note.editedOn = Math.floor(Date.now() / 1000);
|
||||||
}
|
}
|
||||||
$scope.btx.searcheableString = null;
|
$scope.btx.searcheableString = null;
|
||||||
commentPopup.close();
|
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.$apply();
|
||||||
|
}, 200);
|
||||||
});
|
});
|
||||||
};
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.getAlternativeAmount = function() {
|
$scope.getAlternativeAmount = function() {
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,9 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
$ionicPopup.prompt({
|
$ionicPopup.prompt({
|
||||||
title: title,
|
title: title,
|
||||||
subTitle: message,
|
subTitle: message || ' ',
|
||||||
inputType: opts.inputType,
|
inputType: opts.inputType || 'text',
|
||||||
inputPlaceholder: opts.inputPlaceholder,
|
inputPlaceholder: opts.inputPlaceholder || '',
|
||||||
defaultText: opts.defaultText
|
defaultText: opts.defaultText
|
||||||
}).then(function(res) {
|
}).then(function(res) {
|
||||||
return cb(res)
|
return cb(res)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue