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 context = context || this.context
return !pattern return !pattern
|| pattern == '*' || pattern == '*'
// XXX can we join these into one search??? // jQuery...
|| context.is(pattern) || context.is ?
|| context.find(pattern).length > 0 (context.is(pattern)
|| context.find(pattern).length > 0)
: false
// Vanilla JS...
|| context.matches ?
(context.matches(pattern)
|| !!context.querySelector(pattern))
: false
}, },
__init__: function(keyboard, context){ __init__: function(keyboard, context){