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

Commit c1bdf28

Browse files
committed
having theme be restored on a cache reattach of the settings page
1 parent f1b40ac commit c1bdf28

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

js/views/settingsVw.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ module.exports = pageVw.extend({
147147
this.$obContainer.on('scroll', this.blockedUsersScrollHandler);
148148

149149
if (this.cachedScrollPositions[state]) this.$obContainer[0].scrollTop = this.cachedScrollPositions[state];
150+
this.setTheme();
150151
this.setState(state);
151152
},
152153

@@ -163,17 +164,22 @@ module.exports = pageVw.extend({
163164

164165
this.blockedUsersScrollHandler &&
165166
this.$obContainer.off('scroll', this.blockedUsersScrollHandler);
167+
},
168+
169+
setTheme: function() {
170+
var profile = this.userProfile.get('profile');
171+
172+
if (profile) {
173+
setTheme(profile.primary_color, profile.secondary_color, profile.background_color, profile.text_color);
174+
}
166175
},
167176

168177
fetchModel: function(){
169178
var self = this;
170179
this.firstLoadModerators = true;
171180
this.userProfile.fetch({
172181
success: function(model) {
173-
var profile = model.get('profile');
174-
if (profile){
175-
setTheme(profile.primary_color, profile.secondary_color, profile.background_color, profile.text_color);
176-
}
182+
self.setTheme();
177183
self.model.set({page: model.toJSON()});
178184
self.userModel.fetch({
179185
success: function(model){

0 commit comments

Comments
 (0)