MozReview: Review Page Redesign: Add user session cookie for commits table persistence (
Bug 1309964). r?glob
MozReview-Commit-ID: BkBk2tKT7A9
--- a/reviewboard/reviewboard/static/rb/js/models/userSessionModel_mozreview.js
+++ b/reviewboard/reviewboard/static/rb/js/models/userSessionModel_mozreview.js
@@ -113,16 +113,17 @@ StoredItems = RB.BaseResource.extend({
*
* There should only ever be one instance of a UserSession. It should always
* be created through UserSession.create, and retrieved through
* UserSession.instance.
*/
RB.UserSession = Backbone.Model.extend({
defaults: {
authenticated: false,
+ commitsTableAlwaysShowFull: false,
diffsShowExtraWhitespace: false,
diffsHideInlineComments: false,
fullName: null,
loginURL: null,
username: null,
userPageURL: null,
sessionURL: null,
timezoneOffset: '0',
@@ -153,16 +154,24 @@ RB.UserSession = Backbone.Model.extend({
this.mutedReviewRequests = new StoredItems({
url: this.get('mutedReviewRequestsURL'),
removeError: gettext('Must log in to remove a muted item.'),
addError: gettext('Must log in to add a muted item.')
});
this._bindCookie({
+ attr: 'commitsTableAlwaysShowFull',
+ cookieName: 'commits_table_show',
+ deserialize: function(value) {
+ return value !== 'false';
+ }
+ });
+
+ this._bindCookie({
attr: 'diffsShowExtraWhitespace',
cookieName: 'show_ew',
deserialize: function(value) {
return value !== 'false';
}
});
this._bindCookie({