aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/client.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-07-23 19:06:33 -0700
committerAlex Yatskov <alex@foosoft.net>2016-07-23 19:06:33 -0700
commite062ae2063b4a4aa3b284816adee3350e5670a20 (patch)
tree4d24bb9caa32bdd4a700bee850699a388e9d064a /ext/fg/js/client.js
parentb2c19ab9c9ec6034f19d23a3912080bc6e638a2b (diff)
Support looking up definitions for buttons and inputs.
Diffstat (limited to 'ext/fg/js/client.js')
-rw-r--r--ext/fg/js/client.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index 37377984..bb0d3749 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -80,8 +80,15 @@ class Client {
textSourceFromPoint(point) {
const element = document.elementFromPoint(point.x, point.y);
- if (element !== null && element.nodeName === 'IMG') {
- return new TextSourceImage(element);
+ if (element !== null) {
+ switch (element.nodeName) {
+ case 'IMG':
+ return new TextSourceImage(element);
+ case 'INPUT':
+ case 'BUTTON':
+ case 'TEXTAREA':
+ return new TextSourceInput(element);
+ }
}
const range = document.caretRangeFromPoint(point.x, point.y);