diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-07 02:56:46 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-07 03:32:56 +0300 |
commit | 153531fff3c8f32482035bfa87fee2161171e698 (patch) | |
tree | cf230fd34ebb0ddb6d7080388e3815164bc09f11 /app/assets/javascripts/droplab | |
parent | 31c51c8c5f9f6277f9beb734a2579c35c609e707 (diff) |
Finish up feature spec
Diffstat (limited to 'app/assets/javascripts/droplab')
-rw-r--r-- | app/assets/javascripts/droplab/drop_down.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/droplab/plugins/input_setter.js | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/droplab/drop_down.js b/app/assets/javascripts/droplab/drop_down.js index f686ad33f6f..f522859c457 100644 --- a/app/assets/javascripts/droplab/drop_down.js +++ b/app/assets/javascripts/droplab/drop_down.js @@ -35,7 +35,9 @@ Object.assign(DropDown.prototype, { }, clickEvent: function(e) { - var selected = utils.closest(e.target, 'LI'); + if (e.target.tagName === 'UL') return; + + var selected = utils.closest(e.target, 'LI', ''); if (!selected) return; this.addSelectedClass(selected); diff --git a/app/assets/javascripts/droplab/plugins/input_setter.js b/app/assets/javascripts/droplab/plugins/input_setter.js index c292cfa7b8f..d01fbc5830d 100644 --- a/app/assets/javascripts/droplab/plugins/input_setter.js +++ b/app/assets/javascripts/droplab/plugins/input_setter.js @@ -35,8 +35,6 @@ const InputSetter = { const newValue = selectedItem.getAttribute(config.valueAttribute); const inputAttribute = config.inputAttribute; - if (!newValue) return; - if (input.hasAttribute(inputAttribute)) return input.setAttribute(inputAttribute, newValue); if (input.tagName === 'INPUT') return input.value = newValue; return input.textContent = newValue; |