BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
423e0068
Commit
423e0068
authored
Mar 16, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expand the issuable sidebar when coming back from the Changes tab
Unless the user explicitly requested the collapsed sidebar.
parent
dc396d0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
merge_request_tabs.js.coffee
app/assets/javascripts/merge_request_tabs.js.coffee
+22
-3
No files found.
app/assets/javascripts/merge_request_tabs.js.coffee
View file @
423e0068
...
...
@@ -3,6 +3,8 @@
# Handles persisting and restoring the current tab selection and lazily-loading
# content on the MergeRequests#show page.
#
#= require jquery.cookie
#
# ### Example Markup
#
# <ul class="nav-links merge-request-tabs">
...
...
@@ -68,11 +70,15 @@ class @MergeRequestTabs
if
action
==
'commits'
@
loadCommits
(
$target
.
attr
(
'href'
))
@
expandView
()
else
if
action
==
'diffs'
@
loadDiff
(
$target
.
attr
(
'href'
))
@
shrinkView
()
else
if
action
==
'builds'
@
loadBuilds
(
$target
.
attr
(
'href'
))
@
expandView
()
else
@
expandView
()
@
setCurrentAction
(
action
)
...
...
@@ -189,11 +195,24 @@ class @MergeRequestTabs
$
(
'.container-fluid'
).
removeClass
(
'container-limited'
)
shrinkView
:
->
$gutterIcon
=
$
(
'.js-sidebar-toggle i'
)
$gutterIcon
=
$
(
'.js-sidebar-toggle i
:visible
'
)
# Wait until listeners are set
setTimeout
(
->
# Only when sidebar is
collaps
ed
# Only when sidebar is
expand
ed
if
$gutterIcon
.
is
(
'.fa-angle-double-right'
)
$gutterIcon
.
closest
(
'a'
).
trigger
(
'click'
,[
true
])
$gutterIcon
.
closest
(
'a'
).
trigger
(
'click'
,
[
true
])
,
0
)
# Expand the issuable sidebar unless the user explicitly collapsed it
expandView
:
->
return
if
$
.
cookie
(
'collapsed_gutter'
)
==
'true'
$gutterIcon
=
$
(
'.js-sidebar-toggle i:visible'
)
# Wait until listeners are set
setTimeout
(
->
# Only when sidebar is collapsed
if
$gutterIcon
.
is
(
'.fa-angle-double-left'
)
$gutterIcon
.
closest
(
'a'
).
trigger
(
'click'
,
[
true
])
,
0
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment