App loading screen: show messages processed so far

Also, show the same loading screen on index.js before we've bootstrapped
the app.

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-07-25 16:00:06 -07:00
parent e36aa524c9
commit 305bd6b3b8
10 changed files with 110 additions and 25 deletions

View file

@ -64,8 +64,14 @@
Whisper.AppLoadingScreen = Whisper.View.extend({
templateName: 'app-loading-screen',
className: 'app-loading-screen',
updateProgress: function(count) {
if (count > 0) {
var message = i18n('loadingMessages', count.toString());
this.$('.message').text(message);
}
},
render_attributes: {
loading: i18n('loading')
message: i18n('loading')
}
});
@ -171,6 +177,12 @@
view.remove();
}
},
onProgress: function(count) {
var view = this.appLoadingScreen;
if (view) {
view.updateProgress(count);
}
},
focusConversation: function(e) {
if (e && this.$(e.target).closest('.placeholder').length) {
return;