Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2017-10-26 14:17:02 +0300
committerWinnie Hellmann <winnie@gitlab.com>2017-10-26 14:17:02 +0300
commit6bae610c67040a71f19ad74125dc70bf6c33bc0b (patch)
tree7f1f5563ac772151411fabb27e4c9a4b53172208 /app/assets/javascripts/namespace_select.js
parentfcc82ab601f1881558fc246f440f0ebe95bccab7 (diff)
Replace showAny for NamespaceSelect by isFilter
Diffstat (limited to 'app/assets/javascripts/namespace_select.js')
-rw-r--r--app/assets/javascripts/namespace_select.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/assets/javascripts/namespace_select.js b/app/assets/javascripts/namespace_select.js
index 959b52c5608..b53c1591bed 100644
--- a/app/assets/javascripts/namespace_select.js
+++ b/app/assets/javascripts/namespace_select.js
@@ -3,16 +3,13 @@ import Api from './api';
export default class NamespaceSelect {
constructor(opts) {
- var fieldName, showAny;
+ const isFilter = opts.dropdown.dataset.isFilter === 'true';
+ var fieldName;
this.dropdown = $(opts.dropdown);
- showAny = true;
fieldName = 'namespace_id';
if (this.dropdown.attr('data-field-name')) {
fieldName = this.dropdown.data('fieldName');
}
- if (this.dropdown.attr('data-show-any')) {
- showAny = this.dropdown.data('showAny');
- }
this.dropdown.glDropdown({
filterable: true,
selectable: true,
@@ -31,7 +28,7 @@ export default class NamespaceSelect {
data: function(term, dataCallback) {
return Api.namespaces(term, function(namespaces) {
var anyNamespace;
- if (showAny) {
+ if (isFilter) {
anyNamespace = {
text: 'Any namespace',
id: null