Commit 9f0a71f4 authored by Jacob Schatz's avatar Jacob Schatz

Shrink on diff view

Shrinks when navigating to diff view.
Shrinks when refreshing on diff view.
Expandable at anytime.
parent 28d42a33
...@@ -225,6 +225,16 @@ $ -> ...@@ -225,6 +225,16 @@ $ ->
if $gutterIcon.hasClass('fa-angle-double-right') if $gutterIcon.hasClass('fa-angle-double-right')
$gutterIcon.closest('a').trigger('click') $gutterIcon.closest('a').trigger('click')
$(document)
.off 'shown.bs.tab', '.merge-request-tabs a[data-toggle="tab"]'
.on 'shown.bs.tab', '.merge-request-tabs a[data-toggle="tab"]', (e) ->
action = $(e.target).attr("data-action")
if action is 'diffs'
$gutterIcon = $('.gutter-toggle').find('i')
if $gutterIcon.hasClass('fa-angle-double-right')
$gutterIcon.closest('a').trigger('click')
$(document) $(document)
.off 'click', 'aside .gutter-toggle' .off 'click', 'aside .gutter-toggle'
.on 'click', 'aside .gutter-toggle', (e) -> .on 'click', 'aside .gutter-toggle', (e) ->
......
...@@ -3,6 +3,20 @@ module NavHelper ...@@ -3,6 +3,20 @@ module NavHelper
cookies[:collapsed_nav] == 'true' cookies[:collapsed_nav] == 'true'
end end
def sidebar_gutter_collapsed_class
if current_path?('merge_requests#diffs') ||
cookies[:collapsed_gutter] == 'true'
"right-sidebar-collapsed"
else
"right-sidebar-expanded"
end
end
def sidebar_gutter_collapsed?
current_path?('merge_requests#diffs') ||
cookies[:collapsed_gutter] == 'true'
end
def nav_sidebar_class def nav_sidebar_class
if nav_menu_collapsed? if nav_menu_collapsed?
"sidebar-collapsed" "sidebar-collapsed"
...@@ -29,6 +43,8 @@ module NavHelper ...@@ -29,6 +43,8 @@ module NavHelper
else else
"page-gutter right-sidebar-expanded" "page-gutter right-sidebar-expanded"
end end
elsif current_path?('merge_requests#diffs')
"page-gutter right-sidebar-collapsed"
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment