MozReview: Review Page Redesign: Add user session cookie for commits table persistence (Bug 1309964). r=glob
authorDavid Walsh <dwalsh@mozilla.com>
Wed, 26 Oct 2016 10:47:21 -0500
changeset 60 e8ee0bfac509a066ecae1ca4913a2244adc89d02
parent 59 4dbe2886b9cfebb33407209040262954c5d052f6
child 61 05b49b352b259595aa46972712393a2e4140cce5
push id35
push userbjones@mozilla.com
push dateMon, 09 Jan 2017 16:24:23 +0000
reviewersglob
bugs1309964
MozReview: Review Page Redesign: Add user session cookie for commits table persistence (Bug 1309964). r=glob MozReview-Commit-ID: BkBk2tKT7A9
reviewboard/reviewboard/static/rb/js/models/userSessionModel_mozreview.js
--- 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({