##// 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 if existing_value != val:
743 if existing_value != val:
744 self.request.session[key] = val
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 $('#content').removeClass("wrapper");
587 $('#content').removeClass("wrapper");
588 $('#content').addClass("wide-mode-wrapper");
588 $('#content').addClass("wide-mode-wrapper");
589 $(node).addClass('btn-success');
589 $(node).addClass('btn-success');
590 return true
590 } else {
591 } else {
591 $('#content').removeClass("wide-mode-wrapper");
592 $('#content').removeClass("wide-mode-wrapper");
592 $('#content').addClass("wrapper");
593 $('#content').addClass("wrapper");
593 $(node).removeClass('btn-success');
594 $(node).removeClass('btn-success');
595 return false
594 }
596 }
595 return false;
597
596 };
598 };
597
599
598 this.toggleComments = function(node, show) {
600 this.toggleComments = function(node, show) {
@@ -959,7 +959,8 b' def get_comments_for(diff_type, comments'
959 text: _gettext('Toggle Wide Mode diff'),
959 text: _gettext('Toggle Wide Mode diff'),
960 action: function () {
960 action: function () {
961 updateSticky();
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 return null;
964 return null;
964 },
965 },
965 url: null,
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 $("#diff_menu").select2({
1011 $("#diff_menu").select2({
1006 minimumResultsForSearch: -1,
1012 minimumResultsForSearch: -1,
1007 containerCssClass: "drop-menu",
1013 containerCssClass: "drop-menu",
General Comments 0
You need to be logged in to leave comments. Login now