Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
1c6c95108cc4
Commit
269aee79
authored
Apr 17, 2015
by
Robert Speicher
Browse files
Let Bootstrap's tab JS handle history
Closes #2219
parent
ee4ccfe7e50f
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/assets/javascripts/merge_request.js.coffee
View file @
1c6c9510
...
...
@@ -58,14 +58,6 @@ class @MergeRequest
,
'json'
bindEvents
:
->
this
.
$
(
'.merge-request-tabs'
).
on
'click'
,
'a'
,
(
event
)
=>
a
=
$
(
event
.
currentTarget
)
href
=
a
.
attr
(
'href'
)
History
.
replaceState
{
path
:
href
},
document
.
title
,
href
event
.
preventDefault
()
this
.
$
(
'.merge-request-tabs'
).
on
'click'
,
'li'
,
(
event
)
=>
this
.
activateTab
(
$
(
event
.
currentTarget
).
data
(
'action'
))
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
1c6c9510
...
...
@@ -36,17 +36,17 @@
-
if
@commits
.
present?
%ul
.nav.nav-tabs.merge-request-tabs
%li
.notes-tab
{
data:
{
action:
'notes'
}}
%li
.notes-tab
{
data:
{
action:
'notes'
,
toggle:
'tab'
}}
=
link_to
merge_request_path
(
@merge_request
)
do
%i
.fa.fa-comments
Discussion
%span
.badge
=
@merge_request
.
mr_and_commit_notes
.
user
.
count
%li
.commits-tab
{
data:
{
action:
'commits'
}}
%li
.commits-tab
{
data:
{
action:
'commits'
,
toggle:
'tab'
}}
=
link_to
merge_request_path
(
@merge_request
),
title:
'Commits'
do
%i
.fa.fa-history
Commits
%span
.badge
=
@commits
.
size
%li
.diffs-tab
{
data:
{
action:
'diffs'
}}
%li
.diffs-tab
{
data:
{
action:
'diffs'
,
toggle:
'tab'
}}
=
link_to
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
do
%i
.fa.fa-list-alt
Changes
...
...
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