summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2017-01-21 01:26:21 +0000
committerStan Hu <stanhu@gmail.com>2017-01-21 22:13:28 -0800
commit73d5f63df02b9617be215c81f84316fe4a0483bb (patch)
treebc744107407fb68bf275d9a5be487e5ffe30e1f3 /app
parent28353e6f4c9ea26e3b0feb00fe0c56f3597aefd4 (diff)
downloadgitlab-ce-73d5f63df02b9617be215c81f84316fe4a0483bb.tar.gz
Merge branch '26617-search-bar-filter-dropdown-does-not-dismiss-when-sort-dropdown-is-selected' into 'master'
Changed the event listener target from window to document in droplab Closes #26617 See merge request !8670
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/droplab/droplab.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/assets/javascripts/droplab/droplab.js b/app/assets/javascripts/droplab/droplab.js
index ed545ec8748..6c6d650db3a 100644
--- a/app/assets/javascripts/droplab/droplab.js
+++ b/app/assets/javascripts/droplab/droplab.js
@@ -126,7 +126,7 @@ Object.assign(DropDown.prototype, {
var item = this.items[i];
sampleItem = item;
if(item.parentNode && item.parentNode.dataset.hasOwnProperty('dynamic')) {
- item.parentNode.removeChild(item);
+ item.parentNode.removeChild(item);
}
}
@@ -156,7 +156,7 @@ Object.assign(DropDown.prototype, {
if(toAppend) {
toAppend.innerHTML = newChildren.join('');
} else {
- this.list.innerHTML = newChildren.join('');
+ this.list.innerHTML = newChildren.join('');
}
},
@@ -278,7 +278,7 @@ require('./window')(function(w){
self.hooks[i].list.hide();
}
}.bind(this);
- w.addEventListener('click', this.windowClickedWrapper);
+ document.addEventListener('click', this.windowClickedWrapper);
},
removeEvents: function(){
@@ -307,7 +307,7 @@ require('./window')(function(w){
if(!list){
list = document.querySelector(hook.dataset[utils.toDataCamelCase(DATA_TRIGGER)]);
}
-
+
if(hook) {
if(hook.tagName === 'A' || hook.tagName === 'BUTTON') {
this.hooks.push(new HookButton(hook, list, plugins, config));
@@ -578,7 +578,7 @@ require('./window')(function(w){
var listItems = removeHighlight(list);
if(currentIndex>0){
if(!listItems[currentIndex-1]){
- currentIndex = currentIndex-1;
+ currentIndex = currentIndex-1;
}
listItems[currentIndex-1].classList.add('dropdown-active');
}
@@ -630,7 +630,7 @@ require('./window')(function(w){
return;
}
if(currentKey === 'ArrowUp') {
- isUpArrow = true;
+ isUpArrow = true;
}
if(currentKey === 'ArrowDown') {
isDownArrow = true;
@@ -677,7 +677,7 @@ var closest = function(thisTag, stopTag) {
var isDropDownParts = function(target) {
if(target.tagName === 'HTML') { return false; }
return (
- target.hasAttribute(DATA_TRIGGER) ||
+ target.hasAttribute(DATA_TRIGGER) ||
target.hasAttribute(DATA_DROPDOWN)
);
};