mirror of https://github.com/BTCPrivate/copay.git
refactor
This commit is contained in:
parent
2813216a66
commit
26cbf211f5
|
@ -134,7 +134,7 @@
|
||||||
</div>
|
</div>
|
||||||
</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>Payment Proposals</h4>
|
||||||
<h4 ng-show="!index.requiresMultipleSignatures" class="title m0" translate>Unsent transactions</h4>
|
<h4 ng-show="!index.requiresMultipleSignatures" class="title m0" translate>Unsent transactions</h4>
|
||||||
<div class="last-transactions pr" ng-repeat="tx in index.txps">
|
<div class="last-transactions pr" ng-repeat="tx in index.txps">
|
||||||
|
@ -159,9 +159,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="oh pr" ng-show="index.txHistory[0] || index.txProgress > 5">
|
<div class="oh pr" ng-show="index.txHistory[0] || index.txProgress > 5">
|
||||||
<h4 class="title m0">
|
<ul class="no-bullet m0">
|
||||||
<span translate>Activity</span>
|
<li ng-click="home.searchInput()" ng-show="!home.isSearching">
|
||||||
|
<h4 class="title m0" translate>Activity
|
||||||
|
<a><i class="fi-magnifying-glass"></i></a>
|
||||||
</h4>
|
</h4>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<div ng-show="index.updatingTxHistory && index.txProgress > 5">
|
<div ng-show="index.updatingTxHistory && index.txProgress > 5">
|
||||||
<div class="row p20 text-center">
|
<div class="row p20 text-center">
|
||||||
|
@ -195,15 +199,27 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="left-inner-addon ">
|
<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>
|
<i class="fi-magnifying-glass"></i>
|
||||||
<input type="text"
|
<form ng-submit="index.filter(search)">
|
||||||
class="form-control"
|
<input name="search"
|
||||||
placeholder="Amount, address, mm/dd/yyyy"
|
type="text"
|
||||||
|
placeholder="{{'Amount, address, note, mm/dd/yyyy' | translate}}"
|
||||||
ng-model="search"></input>
|
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>
|
||||||
<div ng-repeat="btx in index.filter(search) track by btx.txid"
|
<div ng-repeat="btx in index.txHistoryToShow() track by btx.txid"
|
||||||
fast-click callback-fn="home.openTxModal(btx)"
|
ng-click="home.openTxModal(btx)"
|
||||||
class="row collapse last-transactions-content">
|
class="row collapse last-transactions-content">
|
||||||
<div class="large-6 medium-6 small-6 columns size-14">
|
<div class="large-6 medium-6 small-6 columns size-14">
|
||||||
<div class="m10r left">
|
<div class="m10r left">
|
||||||
|
@ -251,7 +267,7 @@
|
||||||
</div>
|
</div>
|
||||||
</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="columns large-12 medium-12 small-12">
|
||||||
<div class="spinner">
|
<div class="spinner">
|
||||||
<div class="rect1"></div>
|
<div class="rect1"></div>
|
||||||
|
|
|
@ -790,6 +790,8 @@ table tbody tr:last-child td {
|
||||||
.left-inner-addon input {
|
.left-inner-addon input {
|
||||||
padding-left: 40px;
|
padding-left: 40px;
|
||||||
margin-bottom: auto;
|
margin-bottom: auto;
|
||||||
|
max-width: 85%;
|
||||||
|
border: 0px solid;
|
||||||
}
|
}
|
||||||
.left-inner-addon i {
|
.left-inner-addon i {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -799,7 +801,7 @@ table tbody tr:last-child td {
|
||||||
.left-inner-addon a {
|
.left-inner-addon a {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
right: 0px;
|
right: 0.5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*//////////////////////////// BUTTON OUTLINE ////////////////////////////*/
|
/*//////////////////////////// BUTTON OUTLINE ////////////////////////////*/
|
||||||
|
|
|
@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
var self = this;
|
var self = this;
|
||||||
var SOFT_CONFIRMATION_LIMIT = 12;
|
var SOFT_CONFIRMATION_LIMIT = 12;
|
||||||
var errors = bwcService.getErrors();
|
var errors = bwcService.getErrors();
|
||||||
|
<<<<<<< 0b48a2e2f3178bc3dd4062c7c17fe59e89554285
|
||||||
var historyUpdateInProgress = {};
|
var historyUpdateInProgress = {};
|
||||||
|
|
||||||
var ret = {};
|
var ret = {};
|
||||||
|
@ -18,6 +19,28 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
ret.prevState = 'walletHome';
|
ret.prevState = 'walletHome';
|
||||||
|
|
||||||
ret.menu = [{
|
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'),
|
'title': gettext('Receive'),
|
||||||
'icon': {
|
'icon': {
|
||||||
false: 'icon-receive',
|
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.filter = function(search) {
|
||||||
|
self.matches = false;
|
||||||
|
|
||||||
function formatDate(date) {
|
function formatDate(date) {
|
||||||
var day = ('0' + date.getDate()).slice(-2).toString();
|
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('/');
|
return [month, day, year].join('/');
|
||||||
};
|
};
|
||||||
|
|
||||||
if (lodash.isEmpty(search)) return self.txHistory;
|
if (lodash.isEmpty(search)) return;
|
||||||
var result = lodash.filter(self.txHistory, function(tx) {
|
self.result = lodash.filter(self.txHistory, function(tx) {
|
||||||
return lodash.includes(tx.amountStr, search) ||
|
return lodash.includes(tx.amountStr, search) ||
|
||||||
lodash.includes(tx.message, search) ||
|
lodash.includes(tx.message, search) ||
|
||||||
lodash.includes(self.addressbook[tx.addressTo], search) ||
|
lodash.includes(self.addressbook[tx.addressTo], search) ||
|
||||||
lodash.includes(tx.addressTo, search) ||
|
lodash.includes(tx.addressTo, search) ||
|
||||||
lodash.isEqual(formatDate(new Date(tx.time * 1000)), 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) {
|
self.getTxsFromServer = function(client, skip, endingTxid, limit, cb) {
|
||||||
var res = [];
|
var res = [];
|
||||||
|
@ -1202,6 +1236,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
$rootScope.$on('Local/Searching', function(event, val) {
|
$rootScope.$on('Local/Searching', function(event, val) {
|
||||||
if (val) self.showAllHistory();
|
if (val) self.showAllHistory();
|
||||||
else self.hideHistory();
|
else self.hideHistory();
|
||||||
|
self.isSearching = val;
|
||||||
|
self.matches = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// UX event handlers
|
// UX event handlers
|
||||||
|
|
|
@ -55,7 +55,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
self.setAddress();
|
self.setAddress();
|
||||||
self.setSendFormInputs();
|
self.setSendFormInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
$log.debug('Cleaning WalletHome Instance');
|
$log.debug('Cleaning WalletHome Instance');
|
||||||
lodash.each(self, function(v, k) {
|
lodash.each(self, function(v, k) {
|
||||||
if (lodash.isFunction(v)) return;
|
if (lodash.isFunction(v)) return;
|
||||||
|
|
Loading…
Reference in New Issue