Skip to content
Snippets Groups Projects
Commit 2c6471dd authored by Jose Ivan Vargas Lopez's avatar Jose Ivan Vargas Lopez
Browse files

Changed the event listener target from window to document in droplab

parent 4af1f186
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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);
}
}
 
Loading
Loading
@@ -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('');
}
},
 
Loading
Loading
@@ -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(){
Loading
Loading
@@ -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));
Loading
Loading
@@ -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');
}
Loading
Loading
@@ -630,7 +630,7 @@ require('./window')(function(w){
return;
}
if(currentKey === 'ArrowUp') {
isUpArrow = true;
isUpArrow = true;
}
if(currentKey === 'ArrowDown') {
isDownArrow = true;
Loading
Loading
@@ -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)
);
};
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment