summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-10-28 20:09:23 +0200
committerAlon Levy <alon@pobox.com>2014-10-28 20:09:23 +0200
commit17e5aa9fbf95c38c7896d9121fe53ac4f522d327 (patch)
tree4528d31fec6f45204d9b8a4d8d4e3ee30def626e
parent1169d0fff03ee7642a8b5e06462781f8996bb6e5 (diff)
robot: unbreak - setting value doesn't trigger input event
Broken since e299a57a72ee786818cad4f9b8e3aea3b6fb8544 Polling replaced by input event. Polling was a catch all - it checked value change. catching events requires they be thrown, so throw an input even explicitly from robot.
-rw-r--r--scripts/robot.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/robot.js b/scripts/robot.js
index 15265b78..420b75a7 100644
--- a/scripts/robot.js
+++ b/scripts/robot.js
@@ -35,6 +35,9 @@ var robot = function (element, sentence) {
r.counter++;
if (r.sentence.charAt(r.counter) !== "|") {
r.element.val(text + r.sentence.charAt(r.counter));
+ if ('oninput' in document.documentElement) {
+ r.element.trigger('input', {});
+ }
//if(Math.random()>0.9)graph.editType("x","temp",nodetypes[Math.round(Math.random()*4)]);
if (r.sentence.charAt(r.counter)==="#") {
r.sentencecounter++;