From af9100593b6281969b0114d05e6a105d533246a1 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Wed, 8 Aug 2018 08:39:26 +0300 Subject: $$ as document.getElementsByClassName() --- kvmd/web/js/keyboard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kvmd/web/js/keyboard.js') diff --git a/kvmd/web/js/keyboard.js b/kvmd/web/js/keyboard.js index 67553159..15cab179 100644 --- a/kvmd/web/js/keyboard.js +++ b/kvmd/web/js/keyboard.js @@ -17,7 +17,7 @@ var keyboard = new function() { $("stream-window").onkeydown = (event) => __keyboardHandler(event, true); $("stream-window").onkeyup = (event) => __keyboardHandler(event, false); - Array.prototype.forEach.call(document.getElementsByClassName("key"), function(el_key) { + Array.prototype.forEach.call($$("key"), function(el_key) { el_key.onmousedown = () => __clickHandler(el_key, true); el_key.onmouseup = () => __clickHandler(el_key, false); el_key.onmouseout = function() { @@ -27,7 +27,7 @@ var keyboard = new function() { }; __keys.push(el_key); }); - Array.prototype.forEach.call(document.getElementsByClassName("modifier"), function(el_key) { + Array.prototype.forEach.call($$("modifier"), function(el_key) { el_key.onmousedown = () => __toggleModifierHandler(el_key); __modifiers.push(el_key); }); -- cgit v1.2.3