diff options
author | Devaev Maxim <[email protected]> | 2018-08-27 13:33:15 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-08-27 13:33:15 +0300 |
commit | 9a243eaa0402aebc61cd7a247a04b57bd8ec0ad3 (patch) | |
tree | 7fb8b66ac413ad516b517542cacb4895e41b8710 /kvmd/web/js/mouse.js | |
parent | a8773eab1e8f82a7bd862492e5520dcb9690a5e0 (diff) |
refactoring
Diffstat (limited to 'kvmd/web/js/mouse.js')
-rw-r--r-- | kvmd/web/js/mouse.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/kvmd/web/js/mouse.js b/kvmd/web/js/mouse.js index 1ba1f850..9ee92053 100644 --- a/kvmd/web/js/mouse.js +++ b/kvmd/web/js/mouse.js @@ -38,7 +38,17 @@ function Mouse() { } }; - self.updateLeds = function() { + var __hoverStream = function() { + __stream_hovered = true; + __updateLeds(); + }; + + var __leaveStream = function() { + __stream_hovered = false; + __updateLeds(); + }; + + var __updateLeds = function() { if (__ws && __stream_hovered) { $("hid-mouse-led").className = "led-on"; $("hid-mouse-led").title = "Mouse tracked"; @@ -48,16 +58,6 @@ function Mouse() { } }; - var __hoverStream = function() { - __stream_hovered = true; - self.updateLeds(); - }; - - var __leaveStream = function() { - __stream_hovered = false; - self.updateLeds(); - }; - var __touchHandler = function(event, state) { if (state) { var rect = event.touches[0].target.getBoundingClientRect(); |