diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-07-25 20:43:35 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-07-25 20:43:35 -0700 |
commit | 43e20245294bed250ba949be414a1dff3d8d45fb (patch) | |
tree | e0251d10412f8c5850928f0d4ae6712721c782a8 /ext/fg/js/client.js | |
parent | 3ffcf184bb13b40f69cd070515c37fabd85c273f (diff) |
Cleanup
Diffstat (limited to 'ext/fg/js/client.js')
-rw-r--r-- | ext/fg/js/client.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js index a98f715a..34a1a605 100644 --- a/ext/fg/js/client.js +++ b/ext/fg/js/client.js @@ -211,13 +211,9 @@ class Client { static textSourceFromPoint(point) { const element = document.elementFromPoint(point.x, point.y); if (element !== null) { - switch (element.nodeName) { - case 'IMG': - return new TextSourceImage(element); - case 'INPUT': - case 'BUTTON': - case 'TEXTAREA': - return new TextSourceInput(element); + const names = ['IMG', 'INPUT', 'BUTTON', 'TEXTAREA']; + if (names.indexOf(element.nodeName) !== -1) { + return new TextSourceElement(element); } } |