Permalink
Browse files

fixed events with no target class

  • Loading branch information...
sslivkoff committed Jul 14, 2017
1 parent 425d764 commit d9005ad3a405a3e48c039d17e472063e9e761b5f
Showing with 3 additions and 1 deletion.
  1. +2 −0 .gitignore
  2. +1 −1 cortex/webgl/resources/js/menu.js
View
@@ -47,3 +47,5 @@ nosetests.xml
# vim temp files
*~
*.nfs*
@@ -156,7 +156,7 @@ var jsplot = (function (module) {
var key = desc.key;
var action = desc.action;
window.addEventListener("keypress", function(event) {
if (event.target.nodeName === 'INPUT' && (event.target.id !== "" || event.target.classList.index("select2-search__field") ==! -1)) {
if (event.target.nodeName === 'INPUT' && (event.target.id !== "" || (event.target.hasOwnProperty('classList') && event.target.classList.index("select2-search__field") ==! -1))) {
// note: normally you would want to block on all INPUT target tags. however, if you tab-key away from an input element, INPUT remains the target even if the element has been manually deblurred, but the id *will* be cleared. since it would be nice to be able to use shortcuts after tab-aways, this statement only blocks events from inputs with ids
return;
}

0 comments on commit d9005ad

Please sign in to comment.