making keyboard.js depend less on jQuery...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-05-18 00:10:06 +03:00
parent 1e095bf53a
commit 9428a8745c

View File

@ -1088,9 +1088,16 @@ var KeyboardWithCSSModesPrototype = {
context = context || this.context
return !pattern
|| pattern == '*'
// XXX can we join these into one search???
|| context.is(pattern)
|| context.find(pattern).length > 0
// jQuery...
|| context.is ?
(context.is(pattern)
|| context.find(pattern).length > 0)
: false
// Vanilla JS...
|| context.matches ?
(context.matches(pattern)
|| !!context.querySelector(pattern))
: false
},
__init__: function(keyboard, context){