Merge pull request #3852 from tanojaja/fix/responsiveness

reduces the response time when close preferences
This commit is contained in:
Gustavo Maximiliano Cortez 2016-02-10 09:26:00 -05:00
commit e8af7bdda3
2 changed files with 12 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<nav ng-controller="topbarController as topbar" <nav ng-controller="topbarController as topbar"
class="tab-bar" class="tab-bar"
ng-style="{'background-color': noColor ? '#4B6178' : index.backgroundColor}"> ng-style="{'background-color': noColor ? '#4B6178' : index.backgroundColor}">
<section class="left-small"> <section class="left-small">
<a id="hamburger" class="p10" ng-show="!goBackToState && !closeToHome && !index.noFocusedWallet" <a id="hamburger" class="p10" ng-show="!goBackToState && !closeToHome && !index.noFocusedWallet"
@ -11,13 +11,13 @@
</a> </a>
<a ng-show="closeToHome" class="p10 " <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> <span class="text-close">{{'Close'|translate}}</span>
</a> </a>
</section> </section>
<section class="right-small" ng-show="showPreferences && !index.noFocusedWallet"> <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> <i class="fi-widget size-24"></i>
</a> </a>
</section> </section>

View File

@ -926,7 +926,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
if (walletId == profileService.focusedClient.credentials.walletId) { if (walletId == profileService.focusedClient.credentials.walletId) {
self.completeHistory = newHistory; self.completeHistory = newHistory;
self.txHistory = newHistory.slice(0, self.historyShowLimit); self.txHistory = newHistory.slice(0, self.historyShowLimit);
self.historyShowShowAll = newHistory.length >= self.historyShowLimit; self.historyShowShowAll = newHistory.length > self.historyShowLimit;
} }
return storageService.setTxHistory(JSON.stringify(newHistory), walletId, function() { return storageService.setTxHistory(JSON.stringify(newHistory), walletId, function() {
@ -935,6 +935,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}); });
}); });
} }
self.showAllHistory = function() { self.showAllHistory = function() {
self.historyShowShowAll = false; self.historyShowShowAll = false;
self.historyRendering = true; self.historyRendering = true;
@ -995,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.debounceUpdateHistory = lodash.debounce(function() {
self.updateHistory(); self.updateHistory();
}, 1000); }, 1000);