##// END OF EJS Templates
diffs: store wide-diff mode in user sessions for saved state.
marcink -
r3642:ffe3283f new-ui
parent child Browse files
Show More
@@ -743,4 +743,4 b' class HomeView(BaseAppView):'
743 743 if existing_value != val:
744 744 self.request.session[key] = val
745 745
746 return 'stored:{}'.format(key)
746 return 'stored:{}:{}'.format(key, val)
@@ -587,12 +587,14 b' var CommentsController = function() {'
587 587 $('#content').removeClass("wrapper");
588 588 $('#content').addClass("wide-mode-wrapper");
589 589 $(node).addClass('btn-success');
590 return true
590 591 } else {
591 592 $('#content').removeClass("wide-mode-wrapper");
592 593 $('#content').addClass("wrapper");
593 594 $(node).removeClass('btn-success');
595 return false
594 596 }
595 return false;
597
596 598 };
597 599
598 600 this.toggleComments = function(node, show) {
@@ -959,7 +959,8 b' def get_comments_for(diff_type, comments'
959 959 text: _gettext('Toggle Wide Mode diff'),
960 960 action: function () {
961 961 updateSticky();
962 Rhodecode.comments.toggleWideMode(this);
962 var wide = Rhodecode.comments.toggleWideMode(this);
963 storeUserSessionAttr('rc_user_session_attr.wide_diff_mode', wide);
963 964 return null;
964 965 },
965 966 url: null,
@@ -1002,6 +1003,11 b' def get_comments_for(diff_type, comments'
1002 1003 ]
1003 1004 };
1004 1005
1006 // get stored diff mode and pre-enable it
1007 if (templateContext.session_attrs.wide_diff_mode === "true") {
1008 Rhodecode.comments.toggleWideMode(null);
1009 }
1010
1005 1011 $("#diff_menu").select2({
1006 1012 minimumResultsForSearch: -1,
1007 1013 containerCssClass: "drop-menu",
General Comments 0
You need to be logged in to leave comments. Login now