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

Commit 86a9ed3

Browse files
committed
- move customization class removal to the remove function of the userPageVw
- comment out old code that doesn't do anything
1 parent 7d1d7c1 commit 86a9ed3

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

js/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ module.exports = Backbone.Router.extend({
183183
cleanup: function(){
184184
$('#loadingModal').addClass('hide'); //hide modal if it is still visible
185185
messageModal.hide();
186-
$('#obContainer').removeClass('modalOpen innerModalOpen customizeUserPage noScrollBar overflowHidden');
186+
$('#obContainer').removeClass('modalOpen innerModalOpen');
187187
window.obEventBus.trigger('cleanNav');
188188
},
189189

js/views/userPageVw.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ UserPageVw = pageVw.extend({
187187
this.followerFetchTotal = 0;
188188
this.itemFetchParameters = {};
189189
this.model = new Backbone.Model();
190-
this.globalUserProfile = options.userProfile;
190+
//this.globalUserProfile = options.userProfile;
191191
this.userProfile = new userProfileModel();
192192
//models have to be passed the dynamic URL
193193
this.userProfile.urlRoot = options.userModel.get('serverUrl') + "profile";
@@ -213,6 +213,7 @@ UserPageVw = pageVw.extend({
213213
this.showNSFWContent = this.showNSFW;
214214
this.currentItemHash = options.itemHash;
215215
this.$obContainer = $('#obContainer');
216+
/*
216217
//hold changes to the page for undoing, such as custom colors
217218
this.undoCustomAttributes = {
218219
profile: {
@@ -222,6 +223,7 @@ UserPageVw = pageVw.extend({
222223
background_color: ""
223224
}
224225
};
226+
*/
225227

226228
this.loadingDeferred = $.Deferred();
227229

@@ -381,11 +383,13 @@ UserPageVw = pageVw.extend({
381383
self.fetchFollowing();
382384
self.getIsModerator();
383385
self.fetchListings();
386+
/*
384387
//save state of the page
385388
self.undoCustomAttributes.background_color = self.model.get('page').profile.background_color;
386389
self.undoCustomAttributes.primary_color = self.model.get('page').profile.primary_color;
387390
self.undoCustomAttributes.secondary_color = self.model.get('page').profile.secondary_color;
388391
self.undoCustomAttributes.text_color = self.model.get('page').profile.text_color;
392+
*/
389393
self.setCustomStyles();
390394
self.setState(self.state, self.currentItemHash, { replaceHistory: true });
391395
self.$backToTop = self.$('.backToTop');
@@ -565,7 +569,7 @@ UserPageVw = pageVw.extend({
565569
this.$el.find('.js-unfollow').removeClass('confirm');
566570
this.$el.find('.js-removemoderator').removeClass('confirm');
567571
this.$el.find('.user-page-header-slim-bg-cover').removeClass('user-page-header-slim-bg-cover-customize');
568-
this.$obContainer[0].classList.remove("customizeUserPage", "noScrollBar", "overflowHidden");
572+
this.$obContainer.removeClass("customizeUserPage", "noScrollBar", "overflowHidden");
569573
//unhide the ones that are needed
570574
if (this.options.ownPage === true) {
571575
if (state === "listing" || state === "listingOld") {
@@ -576,7 +580,7 @@ UserPageVw = pageVw.extend({
576580
this.$el.find('.js-pageCustomizationButtons').removeClass('hide');
577581
this.$el.find('#customizeControls').removeClass('hide');
578582
this.$el.find('.user-page-header-slim-bg-cover').addClass('user-page-header-slim-bg-cover-customize');
579-
this.$obContainer[0].classList.add("customizeUserPage", "noScrollBar", "overflowHidden");
583+
this.$obContainer.addClass("customizeUserPage", "noScrollBar", "overflowHidden");
580584
} else {
581585
this.$el.find('.js-pageButtons').removeClass('hide');
582586
}
@@ -1430,7 +1434,7 @@ UserPageVw = pageVw.extend({
14301434
}
14311435

14321436
//refresh the universal profile model
1433-
self.globalUserProfile.fetch();
1437+
//self.globalUserProfile.fetch();
14341438
} else if (data.success === false && !self.isRemoved()){
14351439
messageModal.show(window.polyglot.t('errorMessages.serverError'), "<i>" + data.reason + "</i>");
14361440
}
@@ -1768,10 +1772,9 @@ UserPageVw = pageVw.extend({
17681772
},
17691773

17701774
remove: function(){
1771-
// close colorbox to make sure the overlay doesnt remain open when going to a different page
1772-
//$.colorbox.close();
17731775
messageModal.$el.off('click', this.modalCloseHandler);
1774-
$('#obContainer').off('scroll', this.onScroll);
1776+
this.$obContainer.removeClass("customizeUserPage", "noScrollBar", "overflowHidden")
1777+
.off('scroll', this.onScroll);
17751778

17761779
pageVw.prototype.remove.apply(this, arguments);
17771780
}

0 commit comments

Comments
 (0)