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

Commit 69931d2

Browse files
committed
showing loading spinner when settings is initially loading
1 parent bac14a7 commit 69931d2

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

css/obBase.css

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -419,13 +419,6 @@ h6, .h6 {
419419
-webkit-app-region: no-drag;
420420
}
421421

422-
#appBar .title {
423-
/* since the loading spinners are centered in a manner
424-
where chat is excluded from the width, we'll follow
425-
suit here so our title is centered with the spinners */
426-
width: calc(100% - 45px);
427-
}
428-
429422
#pageNav .btn {
430423
-webkit-app-region: no-drag;
431424
}
@@ -4434,7 +4427,6 @@ input[type="checkbox"].fieldItem:checked + label .togLabelOff {
44344427
left: 0;
44354428
top: 50%;
44364429
margin-top: 117px;
4437-
margin-left: -40px;
44384430
opacity: 1;
44394431
transition: opacity 1s 5s ease;
44404432
box-sizing: border-box;

js/router.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,6 @@ module.exports = Backbone.Router.extend({
444444
},
445445

446446
settings: function(state){
447-
$('.js-loadingModal').addClass('show');
448-
449447
this.newView(settingsView, {
450448
viewArgs: {
451449
userModel: this.userModel,

js/views/settingsVw.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ module.exports = pageVw.extend({
6868

6969
initialize: function(options){
7070
var self = this;
71+
72+
$('.js-loadingModal').removeClass('hide');
7173
this.options = options || {};
7274
/* expected options:
7375
userModel
@@ -175,14 +177,18 @@ module.exports = pageVw.extend({
175177
getBTPrice("USD", function (btAve, currencyList) {
176178
self.availableCurrenciesList = currencyList;
177179
self.render();
178-
$('.js-loadingModal').removeClass('show');
179180
});
180181
}
181182
});
182183
},
183184
error: function(model, response){
184185
console.log(response);
185186
messageModal.show(window.polyglot.t('errorMessages.getError'), window.polyglot.t('errorMessages.userError'));
187+
},
188+
complete: function() {
189+
if (!self.isRemoved()) {
190+
$('.js-loadingModal').addClass('hide');
191+
}
186192
}
187193
});
188194
},

0 commit comments

Comments
 (0)