changes in ui and ux

This commit is contained in:
Gabriel Bazán 2016-02-15 12:50:21 -03:00
commit 284c47bf49
3 changed files with 44 additions and 29 deletions

View file

@ -30,6 +30,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.updatingTxHistory = {};
self.prevState = 'walletHome';
self.isSearching = false;
self.showOptions = true;
function strip(number) {
return (parseFloat(number.toPrecision(12)));
@ -947,15 +948,16 @@ angular.module('copayApp.controllers').controller('indexController', function($r
};
self.txHistoryToShow = function() {
if (!self.isSearching) {
self.result = [];
return self.txHistory;
if (!self.isSearching) {
self.result = [];
return self.txHistory;
} else return self.result;
}
}
self.filter = function(search) {
self.matches = false;
self.showOptions = true;
self.result = [];
function formatDate(date) {
var day = ('0' + date.getDate()).slice(-2).toString();
var month = ('0' + (date.getMonth() + 1)).slice(-2).toString();
@ -964,6 +966,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
};
if (lodash.isEmpty(search)) return;
self.result = lodash.filter(self.txHistory, function(tx) {
return lodash.includes(tx.amountStr, search) ||
lodash.includes(tx.message, search) ||
@ -973,8 +976,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
});
if (isCordova)
window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + self.result.length));
else
self.matches = true;
self.showOptions = (self.result.length == 0) ? true : false;
};
self.getTxsFromServer = function(client, skip, endingTxid, limit, cb) {
@ -1237,7 +1239,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
if (val) self.showAllHistory();
else self.hideHistory();
self.isSearching = val;
self.matches = false;
self.showOptions = true;
});
// UX event handlers