Commit 41b45ece authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'rs-issue-2219' into 'master'

Let Bootstrap's tab JS handle history

Closes #2219

See merge request !1784
parents 359f01c9 269aee79
...@@ -58,14 +58,6 @@ class @MergeRequest ...@@ -58,14 +58,6 @@ class @MergeRequest
, 'json' , 'json'
bindEvents: -> 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.$('.merge-request-tabs').on 'click', 'li', (event) =>
this.activateTab($(event.currentTarget).data('action')) this.activateTab($(event.currentTarget).data('action'))
......
...@@ -36,17 +36,17 @@ ...@@ -36,17 +36,17 @@
- if @commits.present? - if @commits.present?
%ul.nav.nav-tabs.merge-request-tabs %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 = link_to merge_request_path(@merge_request) do
%i.fa.fa-comments %i.fa.fa-comments
Discussion Discussion
%span.badge= @merge_request.mr_and_commit_notes.user.count %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 = link_to merge_request_path(@merge_request), title: 'Commits' do
%i.fa.fa-history %i.fa.fa-history
Commits Commits
%span.badge= @commits.size %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 = link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) do
%i.fa.fa-list-alt %i.fa.fa-list-alt
Changes Changes
......
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