This commit is contained in:
Gabriel Bazán 2016-02-15 12:50:21 -03:00
parent 2813216a66
commit 26cbf211f5
4 changed files with 73 additions and 20 deletions

View File

@ -134,7 +134,7 @@
</div>
</div>
<div class="oh pr" ng-if="index.txps[0]">
<div class="oh pr" ng-if="index.txps[0]" ng-show="!home.isSearching">
<h4 ng-show="index.requiresMultipleSignatures" class="title m0" translate>Payment Proposals</h4>
<h4 ng-show="!index.requiresMultipleSignatures" class="title m0" translate>Unsent transactions</h4>
<div class="last-transactions pr" ng-repeat="tx in index.txps">
@ -159,9 +159,13 @@
</div>
<div class="oh pr" ng-show="index.txHistory[0] || index.txProgress > 5">
<h4 class="title m0">
<span translate>Activity</span>
</h4>
<ul class="no-bullet m0">
<li ng-click="home.searchInput()" ng-show="!home.isSearching">
<h4 class="title m0" translate>Activity
<a><i class="fi-magnifying-glass"></i></a>
</h4>
</li>
</ul>
<div ng-show="index.updatingTxHistory && index.txProgress > 5">
<div class="row p20 text-center">
@ -195,16 +199,28 @@
</div>
</div>
<div class="left-inner-addon ">
<i class="fi-magnifying-glass"></i>
<input type="text"
class="form-control"
placeholder="Amount, address, mm/dd/yyyy"
ng-model="search"></input>
<div id="searchLabel" ng-show="home.isSearching">
<ul class="no-bullet m0">
<li class="left-inner-addon">
<a ng-click="home.cancelSearch()" translate>Cancel</a>
<i class="fi-magnifying-glass"></i>
<form ng-submit="index.filter(search)">
<input name="search"
type="text"
placeholder="{{'Amount, address, note, mm/dd/yyyy' | translate}}"
ng-model="search"></input>
</form>
</li>
<li>
<h4 ng-show="index.matches">
<span class="vm" translate>{{index.result.length}} matches</span>
</h4>
</li>
</ul>
</div>
<div ng-repeat="btx in index.filter(search) track by btx.txid"
fast-click callback-fn="home.openTxModal(btx)"
class="row collapse last-transactions-content">
<div ng-repeat="btx in index.txHistoryToShow() track by btx.txid"
ng-click="home.openTxModal(btx)"
class="row collapse last-transactions-content">
<div class="large-6 medium-6 small-6 columns size-14">
<div class="m10r left">
<img src="img/icon-receive-history.svg" alt="sync" width="40" ng-show="btx.action == 'received'">
@ -251,7 +267,7 @@
</div>
</div>
<div class="row m20t text-center" ng-show="index.historyRendering">
<div class="row m20t text-center" ng-show="index.historyRendering && !home.isSearching">
<div class="columns large-12 medium-12 small-12">
<div class="spinner">
<div class="rect1"></div>

View File

@ -790,6 +790,8 @@ table tbody tr:last-child td {
.left-inner-addon input {
padding-left: 40px;
margin-bottom: auto;
max-width: 85%;
border: 0px solid;
}
.left-inner-addon i {
position: absolute;
@ -799,7 +801,7 @@ table tbody tr:last-child td {
.left-inner-addon a {
position: absolute;
padding: 5px;
right: 0px;
right: 0.5px;
}
/*//////////////////////////// BUTTON OUTLINE ////////////////////////////*/

View File

@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
var self = this;
var SOFT_CONFIRMATION_LIMIT = 12;
var errors = bwcService.getErrors();
<<<<<<< 0b48a2e2f3178bc3dd4062c7c17fe59e89554285
var historyUpdateInProgress = {};
var ret = {};
@ -18,6 +19,28 @@ angular.module('copayApp.controllers').controller('indexController', function($r
ret.prevState = 'walletHome';
ret.menu = [{
=======
self.isCordova = isCordova;
self.isChromeApp = isChromeApp;
self.isSafari = isMobile.Safari();
self.isWindowsPhoneApp = isMobile.Windows() && isCordova;
self.usePushNotifications = self.isCordova && !isMobile.Windows();
self.onGoingProcess = {};
self.historyShowLimit = 10;
self.updatingTxHistory = {};
self.prevState = 'walletHome';
self.isSearching = false;
function strip(number) {
return (parseFloat(number.toPrecision(12)));
};
self.goHome = function() {
go.walletHome();
};
self.menu = [{
>>>>>>> refactor
'title': gettext('Receive'),
'icon': {
false: 'icon-receive',
@ -923,7 +946,15 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}
};
self.txHistoryToShow = function() {
if (!self.isSearching) {
self.result = [];
return self.txHistory;
} else return self.result;
}
self.filter = function(search) {
self.matches = false;
function formatDate(date) {
var day = ('0' + date.getDate()).slice(-2).toString();
@ -932,16 +963,19 @@ angular.module('copayApp.controllers').controller('indexController', function($r
return [month, day, year].join('/');
};
if (lodash.isEmpty(search)) return self.txHistory;
var result = lodash.filter(self.txHistory, function(tx) {
if (lodash.isEmpty(search)) return;
self.result = lodash.filter(self.txHistory, function(tx) {
return lodash.includes(tx.amountStr, search) ||
lodash.includes(tx.message, search) ||
lodash.includes(self.addressbook[tx.addressTo], search) ||
lodash.includes(tx.addressTo, search) ||
lodash.isEqual(formatDate(new Date(tx.time * 1000)), search);
});
return result;
}
if (isCordova)
window.plugins.toast.showShortBottom(gettextCatalog.getString('Matches: ' + self.result.length));
else
self.matches = true;
};
self.getTxsFromServer = function(client, skip, endingTxid, limit, cb) {
var res = [];
@ -1202,6 +1236,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$rootScope.$on('Local/Searching', function(event, val) {
if (val) self.showAllHistory();
else self.hideHistory();
self.isSearching = val;
self.matches = false;
});
// UX event handlers

View File

@ -55,7 +55,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.setAddress();
self.setSendFormInputs();
}
$log.debug('Cleaning WalletHome Instance');
lodash.each(self, function(v, k) {
if (lodash.isFunction(v)) return;