summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-02-05 18:56:37 +0000
committerPhil Hughes <me@iamphill.com>2016-02-05 18:56:37 +0000
commit0a094cb1dfe7328214c8516d60d51deb13c8fc1a (patch)
tree17cc95a8b337d63a21cea39d0f3f1e6339ca0edd
parent2e8fe0bdb274e8cdc80d0e38fe340832c70adfb2 (diff)
downloadgitlab-ce-0a094cb1dfe7328214c8516d60d51deb13c8fc1a.tar.gz
Changed the project switcher dropdown toggle
Moved the positioning of the dropdown to be more aligned with the title Closes #13219 and #13214
-rw-r--r--app/assets/stylesheets/framework/header.scss9
-rw-r--r--app/helpers/projects_helper.rb4
-rw-r--r--spec/javascripts/fixtures/project_title.html.haml4
3 files changed, 13 insertions, 4 deletions
diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss
index 7871a33b6c5..a81e258573d 100644
--- a/app/assets/stylesheets/framework/header.scss
+++ b/app/assets/stylesheets/framework/header.scss
@@ -91,8 +91,17 @@ header {
.dropdown-toggle-caret {
position: relative;
top: -2px;
+ width: 12px;
+ line-height: 12px;
margin-left: 5px;
font-size: 10px;
+ text-align: center;
+ cursor: pointer;
+ }
+
+ .project-item-select {
+ right: auto;
+ left: 0;
}
}
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 2e9741a8622..04d1f3a0ac2 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -59,9 +59,8 @@ module ProjectsHelper
link_to(simple_sanitize(owner.name), user_path(owner))
end
- project_link = link_to project_path(project), { class: "project-item-select-holder #{"js-projects-dropdown-toggle" if current_user}" } do
+ project_link = link_to project_path(project), { class: "project-item-select-holder" } do
link_output = simple_sanitize(project.name)
- link_output += content_tag :span, nil, { class: "fa fa-chevron-down dropdown-toggle-caret" } if current_user
if current_user
link_output += project_select_tag :project_path,
@@ -71,6 +70,7 @@ module ProjectsHelper
link_output
end
+ project_link += content_tag :span, nil, { class: "fa fa-chevron-down dropdown-toggle-caret js-projects-dropdown-toggle" } if current_user
full_title = namespace_link + ' / ' + project_link
full_title += ' &middot; '.html_safe + link_to(simple_sanitize(name), url) if name
diff --git a/spec/javascripts/fixtures/project_title.html.haml b/spec/javascripts/fixtures/project_title.html.haml
index 4286d1be669..a3bae7045ba 100644
--- a/spec/javascripts/fixtures/project_title.html.haml
+++ b/spec/javascripts/fixtures/project_title.html.haml
@@ -1,7 +1,7 @@
%h1.title
%a
GitLab Org
- %a.project-item-select-holder.js-projects-dropdown-toggle{href: "/gitlab-org/gitlab-test"}
+ %a.project-item-select-holder{href: "/gitlab-org/gitlab-test"}
GitLab Test
- %span.fa.fa-chevron-down.dropdown-toggle-caret
%input#project_path.project-item-select.js-projects-dropdown.ajax-project-select{type: "hidden", name: "project_path", "data-include-groups" => "false"}
+ %span.fa.fa-chevron-down.dropdown-toggle-caret.js-projects-dropdown-toggle