Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit c7c43b1

Browse files
committed
- adds a loading spinner to the transactions tabs
- adds a "none found" message if none were found Closes #1462
1 parent c13bb9e commit c7c43b1

File tree

5 files changed

+36
-6
lines changed

5 files changed

+36
-6
lines changed

js/languages/en-US.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,10 @@
527527
"BuyerPaidMessage": "You have paid %{paidAmount} out of %{totalAmount} BTC",
528528
"BuyerPaidMessageHelp": "To complete your purchase, pay the remaining balance shown above.",
529529
"SellerPaidMessage": "The buyer has paid %{paidAmount} out of %{totalAmount} BTC",
530-
"SellerPaidMessageHelp": "This purchase can not be confirmed until the buyer has completely funded it."
530+
"SellerPaidMessageHelp": "This purchase can not be confirmed until the buyer has completely funded it.",
531+
"NoPurchases": "No purchases were found.",
532+
"NoSales": "No sales were found.",
533+
"NoCases": "No cases were found."
531534
},
532535
"errorMessages": {
533536
"saveError": "Data could not be saved.",

js/start.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,10 @@ $(window).bind('keydown', function(e) {
327327
break;
328328
case window.config.keyShortcuts.refresh:
329329
e.preventDefault();
330-
Backbone.history.loadUrl();
330+
app.router.refresh();
331331
break;
332332
case window.config.keyShortcuts.restart:
333-
app.router.refresh();
333+
location.reload();
334334
break;
335335
}
336336

js/templates/transactions.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ <h1 class="fancy-heading fontSize20 vCentered colorWhiteForce textShadow"><%= po
8585
<input type="text" class="txtField txtField-bar search" placeholder="<%= polyglot.t('transactions.searchByOrder') %>" />
8686
<a class="btn-corner btn-cornerTR ion-close-circled vCentered icon-med hide js-transactionsSearchClear textOpacity50"></a>
8787
</div>
88+
<div class="padding10 width100 alignCenter js-loadingMsg">
89+
<i class="ion-android-sync spinner textSize24px textOpacity50"></i>
90+
</div>
91+
<div class="padding10 width100 alignCenter hide js-emptyMsg">
92+
<%= polyglot.t("transactions.NoPurchases") %>
93+
</div>
8894
</div>
8995

9096
<div class="flexRow flex-border positionWrapper js-tabTarg js-sales hide" id="transactionsSales">
@@ -124,6 +130,12 @@ <h1 class="fancy-heading fontSize20 vCentered colorWhiteForce textShadow"><%= po
124130
<input type="text" class="txtField txtField-bar search" placeholder="<%= polyglot.t('transactions.searchByOrder') %>" />
125131
<a class="btn-corner btn-cornerTR ion-close-circled vCentered icon-med hide js-transactionsSearchClear textOpacity50"></a>
126132
</div>
133+
<div class="padding10 width100 alignCenter js-loadingMsg">
134+
<i class="ion-android-sync spinner textSize24px textOpacity50"></i>
135+
</div>
136+
<div class="padding10 width100 alignCenter hide js-emptyMsg">
137+
<%= polyglot.t("transactions.NoPurchases") %>
138+
</div>
127139
</div>
128140

129141
<div class="flexRow flex-border positionWrapper hide js-tabTarg js-cases" id="transactionsCases">
@@ -137,6 +149,12 @@ <h1 class="fancy-heading fontSize20 vCentered colorWhiteForce textShadow"><%= po
137149
<input type="text" class="txtField txtField-bar search" placeholder="<%= polyglot.t('transactions.searchByOrder') %>" />
138150
<a class="btn-corner btn-cornerTR ion-close-circled vCentered icon-med hide js-transactionsSearchClear textOpacity50"></a>
139151
</div>
152+
<div class="padding10 width100 alignCenter js-loadingMsg">
153+
<i class="ion-android-sync spinner textSize24px textOpacity50"></i>
154+
</div>
155+
<div class="padding10 width100 alignCenter hide js-emptyMsg">
156+
<%= polyglot.t("transactions.NoPurchases") %>
157+
</div>
140158
</div>
141159

142160
</div>

js/views/pageNavVw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = baseVw.extend({
2727
'click .js-showSupportModal': 'showSupportModal',
2828
'click .js-aboutModal .js-tab': 'aboutModalTabClick',
2929
'click .js-navRefresh': 'navRefreshClick',
30-
'click .js-navRestart': 'navRestartClick',
30+
//'click .js-navRestart': 'navRestartClick',
3131
'click .js-navAdminPanel': 'navAdminPanel',
3232
'click .js-navProfileMenu a': 'closeNav',
3333
'focus .js-navAddressBar': 'addressBarFocus',

js/views/transactionsVw.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,19 @@ module.exports = pageVw.extend({
310310
}
311311
});
312312

313+
console.log("test2")
314+
313315
this.$el.find('.js-'+tabName+'Count').html(tabCollection.length);
314-
this.$el.find('.js-'+tabName)
316+
317+
this.$el.find('.js-' + tabName)
315318
.append(tabWrapper)
316-
.find('.js-unpaidCount').html(tabCollection.where({status: 0}).length);
319+
.find('.js-unpaidCount').html(tabCollection.where({status: 0}).length)
320+
.end().find('.js-loadingMsg').addClass('hide');
321+
322+
if (!tabCollection.length) {
323+
console.log("boo")
324+
this.$el.find('.js-'+tabName + ' .js-emptyMsg').removeClass('hide');
325+
}
317326
},
318327

319328
addTransaction: function(model, tabWrapper, type){

0 commit comments

Comments
 (0)