summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/gl_dropdown.js
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-08-01 14:41:24 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-08-01 14:41:24 +0100
commit4028f632ed2eddb9906fc5a1c7ad44e58ee84ac3 (patch)
tree752b357164ba350cfb836de55d7ad5a82866847d /app/assets/javascripts/gl_dropdown.js
parentecd5d3401799e835fa1eb936b0edcd35698742ef (diff)
downloadgitlab-ce-4028f632ed2eddb9906fc5a1c7ad44e58ee84ac3.tar.gz
[ci skip] eslint-fix
Diffstat (limited to 'app/assets/javascripts/gl_dropdown.js')
-rw-r--r--app/assets/javascripts/gl_dropdown.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js b/app/assets/javascripts/gl_dropdown.js
index 5cb31ddd500..8ef75742e0a 100644
--- a/app/assets/javascripts/gl_dropdown.js
+++ b/app/assets/javascripts/gl_dropdown.js
@@ -30,9 +30,9 @@ GitLabDropdownInput = (function() {
}
})
.on('input', function(e) {
- var val = e.currentTarget.value || 'new-branch'
+ var val = e.currentTarget.value || 'new-branch';
val = val.split(' ').join('-') // replaces space with dash
- .replace(/[^a-zA-Z0-9 -]/g, '').toLowerCase() //replace non alphanumeric
+ .replace(/[^a-zA-Z0-9 -]/g, '').toLowerCase() // replace non alphanumeric
.replace(/(-)\1+/g, '-'); // replace repeated dashes
_this.cb(_this.options.fieldName, val, {}, true);
_this.input.closest('.dropdown')
@@ -43,7 +43,7 @@ GitLabDropdownInput = (function() {
GitLabDropdownInput.prototype.onInput = function(cb) {
this.cb = cb;
- }
+ };
return GitLabDropdownInput;
})();
@@ -306,9 +306,9 @@ GitLabDropdown = (function() {
});
}
}
- if(this.noFilterInput.length) {
+ if (this.noFilterInput.length) {
this.plainInput = new GitLabDropdownInput(this.noFilterInput, this.options);
- this.plainInput.onInput(this.addInput.bind(this))
+ this.plainInput.onInput(this.addInput.bind(this));
}
// Init filterable
if (this.options.filterable) {
@@ -798,10 +798,10 @@ GitLabDropdown = (function() {
GitLabDropdown.prototype.addInput = function(fieldName, value, selectedObject, single) {
var $input;
// Create hidden input for form
- if(single){
- $('input[name="' + fieldName + '"]').remove();
+ if (single) {
+ $('input[name="' + fieldName + '"]').remove();
}
-
+
$input = $('<input>').attr('type', 'hidden').attr('name', fieldName).val(value);
if (this.options.inputId != null) {
$input.attr('id', this.options.inputId);