summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-04-19 16:30:26 +0000
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-04-19 16:30:26 +0000
commit41b45ece99ab7ec2069a0ae87776140d2b42307f (patch)
tree0d2a48611bafa1a63d28eda8194163a3e2a34733
parent359f01c9e092291b14755e832d9d9c7dc8ec4a03 (diff)
parent269aee790c48619a92f416c8555cb4623da62ca3 (diff)
downloadgitlab-ce-41b45ece99ab7ec2069a0ae87776140d2b42307f.tar.gz
Merge branch 'rs-issue-2219' into 'master'
Let Bootstrap's tab JS handle history Closes #2219 See merge request !1784
-rw-r--r--app/assets/javascripts/merge_request.js.coffee8
-rw-r--r--app/views/projects/merge_requests/_show.html.haml6
2 files changed, 3 insertions, 11 deletions
diff --git a/app/assets/javascripts/merge_request.js.coffee b/app/assets/javascripts/merge_request.js.coffee
index fc75f143836..ae5d088d593 100644
--- a/app/assets/javascripts/merge_request.js.coffee
+++ b/app/assets/javascripts/merge_request.js.coffee
@@ -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'))
diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml
index a74aede4e6b..cec02de84ca 100644
--- a/app/views/projects/merge_requests/_show.html.haml
+++ b/app/views/projects/merge_requests/_show.html.haml
@@ -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