summaryrefslogtreecommitdiff
path: root/app/views/projects
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-12-08 14:47:28 -0500
committerRobert Speicher <rspeicher@gmail.com>2015-12-08 14:47:28 -0500
commitebee5077f2437d0828784ff23b19ed470bed534d (patch)
tree5d7df6358c7a756d38c1b88ed7b239527a0d377b /app/views/projects
parent02cc978ebc0650284b2b7b0bd4cf0bc633ab788e (diff)
downloadgitlab-ce-ebee5077f2437d0828784ff23b19ed470bed534d.tar.gz
Make tab target selectors less naive
Prior, any of the specified IDs could have been hijacked by a table of contents header, breaking the tab functionality. For example, a `## Notes` header would get the id `notes` and prevent the Discussion tab from being activated. Closes #3908
Diffstat (limited to 'app/views/projects')
-rw-r--r--app/views/projects/merge_requests/_new_submit.html.haml4
-rw-r--r--app/views/projects/merge_requests/_show.html.haml6
2 files changed, 5 insertions, 5 deletions
diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml
index 156922cea41..0bcc826e8d4 100644
--- a/app/views/projects/merge_requests/_new_submit.html.haml
+++ b/app/views/projects/merge_requests/_new_submit.html.haml
@@ -20,11 +20,11 @@
.mr-compare.merge-request
%ul.merge-request-tabs.center-top-menu.no-top.no-bottom
%li.commits-tab
- = link_to url_for(params), data: {target: '#commits', action: 'commits', toggle: 'tab'} do
+ = link_to url_for(params), data: {target: 'div#commits', action: 'commits', toggle: 'tab'} do
Commits
%span.badge= @commits.size
%li.diffs-tab.active
- = link_to url_for(params), data: {target: '#diffs', action: 'diffs', toggle: 'tab'} do
+ = link_to url_for(params), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do
Changes
%span.badge= @diffs.size
diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml
index f5aff0877e7..6a89df38231 100644
--- a/app/views/projects/merge_requests/_show.html.haml
+++ b/app/views/projects/merge_requests/_show.html.haml
@@ -44,15 +44,15 @@
- if @commits.present?
%ul.merge-request-tabs.center-top-menu.no-top.no-bottom
%li.notes-tab
- = link_to namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: '#notes', action: 'notes', toggle: 'tab'} do
+ = link_to namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#notes', action: 'notes', toggle: 'tab'} do
Discussion
%span.badge= @merge_request.mr_and_commit_notes.user.count
%li.commits-tab
- = link_to commits_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: '#commits', action: 'commits', toggle: 'tab'} do
+ = link_to commits_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#commits', action: 'commits', toggle: 'tab'} do
Commits
%span.badge= @commits.size
%li.diffs-tab
- = link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: '#diffs', action: 'diffs', toggle: 'tab'} do
+ = link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do
Changes
%span.badge= @merge_request.diffs.size