summaryrefslogtreecommitdiff
path: root/ext/fg/js/client.js
diff options
context:
space:
mode:
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);
}
}