diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2016-12-07 21:54:29 +0300 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-01-10 01:01:08 +0300 |
commit | bbad61b97c483a2d4e2a153c2e1b10d21edaa1e0 (patch) | |
tree | 045acedc53298dca173c755b6ae3325841c989b3 /app/assets/javascripts/droplab/droplab.js | |
parent | 15454eb503bda8ffa9579e08ebe3f3f7114b7643 (diff) |
Fix Droplab
Diffstat (limited to 'app/assets/javascripts/droplab/droplab.js')
-rw-r--r-- | app/assets/javascripts/droplab/droplab.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/droplab/droplab.js b/app/assets/javascripts/droplab/droplab.js index 6befa0976d4..84cd89297ff 100644 --- a/app/assets/javascripts/droplab/droplab.js +++ b/app/assets/javascripts/droplab/droplab.js @@ -212,7 +212,8 @@ require('./window')(function(w){ var self = this; window.addEventListener('click', function(e){ 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 thisTag = utils.closest(thisTag, 'UL'); } @@ -556,7 +557,7 @@ var camelize = function(str) { }; var closest = function(thisTag, stopTag) { - while(thisTag.tagName !== stopTag && thisTag.tagName !== 'HTML'){ + while(thisTag !== null && thisTag.tagName !== stopTag && thisTag.tagName !== 'HTML'){ thisTag = thisTag.parentNode; } return thisTag; |