Commit bbad61b9 authored by Clement Ho's avatar Clement Ho

Fix Droplab

parent 15454eb5
...@@ -212,7 +212,8 @@ require('./window')(function(w){ ...@@ -212,7 +212,8 @@ require('./window')(function(w){
var self = this; var self = this;
window.addEventListener('click', function(e){ window.addEventListener('click', function(e){
var thisTag = e.target; var thisTag = e.target;
if(thisTag.tagName === 'LI' || thisTag.tagName === 'A'){ if(thisTag.tagName === 'LI' || thisTag.tagName === 'A'
|| thisTag.tagName === 'BUTTON'){
// climb up the tree to find the UL // climb up the tree to find the UL
thisTag = utils.closest(thisTag, 'UL'); thisTag = utils.closest(thisTag, 'UL');
} }
...@@ -556,7 +557,7 @@ var camelize = function(str) { ...@@ -556,7 +557,7 @@ var camelize = function(str) {
}; };
var closest = function(thisTag, stopTag) { var closest = function(thisTag, stopTag) {
while(thisTag.tagName !== stopTag && thisTag.tagName !== 'HTML'){ while(thisTag !== null && thisTag.tagName !== stopTag && thisTag.tagName !== 'HTML'){
thisTag = thisTag.parentNode; thisTag = thisTag.parentNode;
} }
return thisTag; return thisTag;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment