mirror of https://github.com/BTCPrivate/copay.git
convert update tx history event into a function
This commit is contained in:
parent
f3c9728890
commit
eb3680ba6d
|
@ -1,5 +1,5 @@
|
|||
<nav ng-controller="topbarController as topbar"
|
||||
class="tab-bar"
|
||||
<nav ng-controller="topbarController as topbar"
|
||||
class="tab-bar"
|
||||
ng-style="{'background-color': noColor ? '#4B6178' : index.backgroundColor}">
|
||||
<section class="left-small">
|
||||
<a id="hamburger" class="p10" ng-show="!goBackToState && !closeToHome && !index.noFocusedWallet"
|
||||
|
@ -11,13 +11,13 @@
|
|||
</a>
|
||||
|
||||
<a ng-show="closeToHome" class="p10 "
|
||||
ng-click="topbar.goHome(); closeToHome = null">
|
||||
ng-click="topbar.goHome(); index.setCompactTxHistory(); closeToHome = null">
|
||||
<span class="text-close">{{'Close'|translate}}</span>
|
||||
</a>
|
||||
</section>
|
||||
|
||||
<section class="right-small" ng-show="showPreferences && !index.noFocusedWallet">
|
||||
<a class="p10" ng-click="topbar.goPreferences()">
|
||||
<a class="p10" ng-click="topbar.goPreferences(); index.setCompactTxHistory()">
|
||||
<i class="fi-widget size-24"></i>
|
||||
</a>
|
||||
</section>
|
||||
|
|
|
@ -996,6 +996,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
};
|
||||
|
||||
self.setCompactTxHistory = function() {
|
||||
self.txHistory = self.completeHistory.slice(0, self.historyShowLimit);
|
||||
if (self.completeHistory.length > self.historyShowLimit)
|
||||
self.historyShowShowAll = true;
|
||||
};
|
||||
|
||||
self.debounceUpdateHistory = lodash.debounce(function() {
|
||||
self.updateHistory();
|
||||
}, 1000);
|
||||
|
@ -1178,15 +1184,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
};
|
||||
|
||||
$rootScope.$on('Local/UpdateTxHistory', function(event) {
|
||||
$timeout(function () {
|
||||
self.txHistory = self.completeHistory.slice(0, self.historyShowLimit);
|
||||
if (self.completeHistory.length > self.historyShowLimit)
|
||||
self.historyShowShowAll = true;
|
||||
}, 10);
|
||||
});
|
||||
|
||||
|
||||
$rootScope.$on('$stateChangeSuccess', function(ev, to, toParams, from, fromParams) {
|
||||
self.prevState = from.name || 'walletHome';
|
||||
self.tab = 'walletHome';
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('topbarController', function(go, $rootScope) {
|
||||
angular.module('copayApp.controllers').controller('topbarController', function(go) {
|
||||
|
||||
this.goHome = function() {
|
||||
$rootScope.$emit('Local/UpdateTxHistory');
|
||||
go.walletHome();
|
||||
};
|
||||
|
||||
this.goPreferences = function() {
|
||||
$rootScope.$emit('Local/UpdateTxHistory');
|
||||
go.preferences();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue