summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-03-07 15:37:35 +0000
committerPhil Hughes <me@iamphill.com>2016-03-10 13:54:54 +0000
commit4407532911c2fb4841cc51f9779ef51ccb6de099 (patch)
tree0e1aef05b697a05757e513fbbf5cadf84c4fc02c /app/views
parent198926dc7f1bf539862ead04e1e3ebb9d5b9de31 (diff)
downloadgitlab-ce-4407532911c2fb4841cc51f9779ef51ccb6de099.tar.gz
GitLab dropdown JS
Diffstat (limited to 'app/views')
-rw-r--r--app/views/help/ui.html.haml45
1 files changed, 45 insertions, 0 deletions
diff --git a/app/views/help/ui.html.haml b/app/views/help/ui.html.haml
index 0123834bc31..db46e51f8d7 100644
--- a/app/views/help/ui.html.haml
+++ b/app/views/help/ui.html.haml
@@ -390,6 +390,51 @@
%button.btn.btn-primary
Create
+ .example
+ %div
+ .dropdown.inline
+ %button#js-project-dropdown.dropdown-menu-toggle{type: 'button', data: {toggle: 'dropdown'}}
+ Projects
+ = icon('chevron-down')
+ .dropdown-menu.dropdown-select.dropdown-menu-selectable
+ .dropdown-title
+ %span Go to project
+ %button.dropdown-title-button.dropdown-menu-close{aria: {label: "Close"}}
+ = icon('times')
+ .dropdown-input
+ %input.dropdown-input-field{type: "search", placeholder: "Filter results"}
+ = icon('search')
+ .dropdown-content
+ .dropdown-loading
+ = icon('spinner spin')
+ :javascript
+ $('#js-project-dropdown').glDropdown({
+ data: function (callback) {
+ Api.projects("", "last_activity_at", function (data) {
+ callback(data);
+ });
+ },
+ text: function (project) {
+ return project.name_with_namespace || project.name;
+ },
+ selectable: true,
+ fieldName: "author_id",
+ filterable: true,
+ search: {
+ fields: ['name_with_namespace']
+ },
+ id: function (data) {
+ return data.id;
+ },
+ isSelected: function (data) {
+ return data.id === 2;
+ }
+ })
+
+ .example
+ %div
+ = dropdown_tag("Projects", title: "Go to project", filter: true, placeholder: "Filter projects")
+
%h2#panels Panels
.row