refactor
This commit is contained in:
parent
c74e547ad2
commit
58ba939f89
2 changed files with 11 additions and 9 deletions
|
|
@ -197,8 +197,9 @@
|
|||
|
||||
<div id="searchLabel" class="left-inner-addon ">
|
||||
<i class="fi-magnifying-glass"></i>
|
||||
<input ng-click="home.searchInput()"
|
||||
ng-focus="home.formFocus(true)"
|
||||
<input name="search"
|
||||
ng-click="home.searchInput()"
|
||||
ng-focus="home.formFocus('search')"
|
||||
ng-blur="home.formFocus(false)"
|
||||
type="text"
|
||||
placeholder="{{'Amount, address, mm/dd/yyyy' | translate}}"
|
||||
|
|
|
|||
|
|
@ -917,6 +917,14 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
};
|
||||
|
||||
self.filter = function(search) {
|
||||
|
||||
function formatDate(date) {
|
||||
var day = ('0' + date.getDate()).slice(-2).toString();
|
||||
var month = ('0' + (date.getMonth() + 1)).slice(-2).toString();
|
||||
var year = date.getFullYear();
|
||||
return [month, day, year].join('/');
|
||||
};
|
||||
|
||||
if (lodash.isEmpty(search)) return self.txHistory;
|
||||
var result = lodash.filter(self.txHistory, function(tx) {
|
||||
return lodash.includes(tx.amountStr, search) ||
|
||||
|
|
@ -928,13 +936,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
return result;
|
||||
}
|
||||
|
||||
function formatDate(date) {
|
||||
var day = ('0' + date.getDate()).slice(-2).toString();
|
||||
var month = ('0' + (date.getMonth() + 1)).slice(-2).toString();
|
||||
var year = date.getFullYear();
|
||||
return [month, day, year].join('/');
|
||||
};
|
||||
|
||||
self.getTxsFromServer = function(client, skip, endingTxid, limit, cb) {
|
||||
var res = [];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue