diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-07-06 20:04:14 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-07-07 21:25:58 +0300 |
commit | 35224dbf5e88936b138af7e6215a2e4e0503ae97 (patch) | |
tree | 2068701a02326d2c1d273d333cae2dd2e24b483a | |
parent | 338072cc4ba66cd7eb6fbd9541862946e4ae4b75 (diff) |
Do not show Any Namespace option when needed
-rw-r--r-- | app/assets/javascripts/namespace_select.js.coffee | 6 | ||||
-rw-r--r-- | app/views/admin/projects/show.html.haml | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/app/assets/javascripts/namespace_select.js.coffee b/app/assets/javascripts/namespace_select.js.coffee index 3a4b64a18f7..70ceb4d9c7c 100644 --- a/app/assets/javascripts/namespace_select.js.coffee +++ b/app/assets/javascripts/namespace_select.js.coffee @@ -5,12 +5,14 @@ class @NamespaceSelect } = opts showAny = true - fieldName = 'namespace_id' - if @dropdown.data 'fieldName' + if @dropdown.attr 'data-field-name' fieldName = @dropdown.data 'fieldName' + if @dropdown.attr 'data-show-any' + showAny = @dropdown.data 'showAny' + @dropdown.glDropdown( filterable: true selectable: true diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index 7e1f5a52c6f..2c5aba71699 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -100,7 +100,7 @@ = f.label :new_namespace_id, "Namespace", class: 'control-label' .col-sm-10 .dropdown - = dropdown_toggle('Search for Namespace', { toggle: 'dropdown', field_name: 'new_namespace_id' }, { toggle_class: 'js-namespace-select large' }) + = dropdown_toggle('Search for Namespace', { toggle: 'dropdown', field_name: 'new_namespace_id', show_any: 'false' }, { toggle_class: 'js-namespace-select large' }) .dropdown-menu.dropdown-select = dropdown_title('Namespaces') = dropdown_filter("Search for Namespace") |