summaryrefslogtreecommitdiff
path: root/ext/fg/js/client.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-07-25 20:43:35 -0700
committerAlex Yatskov <alex@foosoft.net>2016-07-25 20:43:35 -0700
commit43e20245294bed250ba949be414a1dff3d8d45fb (patch)
treee0251d10412f8c5850928f0d4ae6712721c782a8 /ext/fg/js/client.js
parent3ffcf184bb13b40f69cd070515c37fabd85c273f (diff)
Cleanup
Diffstat (limited to 'ext/fg/js/client.js')
-rw-r--r--ext/fg/js/client.js10
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);
}
}