Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
27a0310f
Commit
27a0310f
authored
Feb 19, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make diff view name getter less error prone
parent
ebceae3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
app/assets/javascripts/merge_request_tabs.js.coffee
app/assets/javascripts/merge_request_tabs.js.coffee
+2
-4
app/helpers/diff_helper.rb
app/helpers/diff_helper.rb
+1
-1
No files found.
app/assets/javascripts/merge_request_tabs.js.coffee
View file @
27a0310f
...
@@ -179,11 +179,9 @@ class @MergeRequestTabs
...
@@ -179,11 +179,9 @@ class @MergeRequestTabs
$
.
ajax
(
options
)
$
.
ajax
(
options
)
# Returns diff view type
diffViewMode
:
->
diffViewMode
:
->
# Gets diff view mode based from its ID
$
(
'.diffs a[id$="-diff-btn"].active'
).
data
(
'view-type'
)
# See diff_btn helper method
btnID
=
$
(
'a[id$="-diff-btn"].active'
).
attr
(
'id'
)
btnID
.
substr
(
0
,
btnID
.
indexOf
(
'-'
))
expandViewContainer
:
->
expandViewContainer
:
->
$
(
'.container-fluid'
).
removeClass
(
'container-limited'
)
$
(
'.container-fluid'
).
removeClass
(
'container-limited'
)
app/helpers/diff_helper.rb
View file @
27a0310f
...
@@ -137,7 +137,7 @@ module DiffHelper
...
@@ -137,7 +137,7 @@ module DiffHelper
# Always use HTML to handle case where JSON diff rendered this button
# Always use HTML to handle case where JSON diff rendered this button
params_copy
.
delete
(
:format
)
params_copy
.
delete
(
:format
)
link_to
url_for
(
params_copy
),
id:
"
#{
name
}
-diff-btn"
,
class:
(
selected
?
'btn active'
:
'btn'
)
do
link_to
url_for
(
params_copy
),
id:
"
#{
name
}
-diff-btn"
,
class:
(
selected
?
'btn active'
:
'btn'
)
,
data:
{
view_type:
name
}
do
title
title
end
end
end
end
...
...
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