fix logs display

This commit is contained in:
antelle 2016-06-04 15:59:03 +03:00
parent bd3423cec1
commit 571702a8f8
3 changed files with 8 additions and 2 deletions

View File

@ -43,7 +43,7 @@ var SettingsGeneralView = Backbone.View.extend({
'click .settings__general-show-logs-link': 'showLogs'
},
views: {},
views: null,
allThemes: {
fb: Locale.setGenThemeFb,
@ -53,6 +53,7 @@ var SettingsGeneralView = Backbone.View.extend({
},
initialize: function() {
this.views = {};
this.listenTo(UpdateModel.instance, 'change:status', this.render, this);
this.listenTo(UpdateModel.instance, 'change:updateStatus', this.render, this);
},
@ -292,7 +293,10 @@ var SettingsGeneralView = Backbone.View.extend({
},
showLogs: function() {
new SettingsLogsView({ el: this.$el.find('.settings__general-advanced') }).render();
if (this.views.logView) {
this.views.logView.remove();
}
this.views.logView = new SettingsLogsView({ el: this.$el.find('.settings__general-advanced') }).render();
this.scrollToBottom();
},

View File

@ -15,6 +15,7 @@ var SettingsLogView = Backbone.View.extend({
};
});
this.renderTemplate({ logs: logs });
return this;
}
});

View File

@ -119,6 +119,7 @@
margin-top: $base-padding-v;
&-log {
margin: 0;
white-space: pre-wrap;
&--debug { color: $white; opacity: .8; }
&--info { color: $white; }
&--warn { color: $yellow; }