Ah, use oninput instead of onchange/onkeypress
This commit is contained in:
parent
7d3b127cf2
commit
fd9ad65092
|
@ -12,7 +12,7 @@ function piece(text, pos, lo, hi, cls) {
|
||||||
function spawnGui() {
|
function spawnGui() {
|
||||||
World.spawn({
|
World.spawn({
|
||||||
boot: function () {
|
boot: function () {
|
||||||
World.updateRoutes([sub(["jQuery", "#inputRow", "keypress", __]),
|
World.updateRoutes([sub(["jQuery", "#inputRow", "+keypress", __]),
|
||||||
sub(["fieldContents", __, __], 0, 1),
|
sub(["fieldContents", __, __], 0, 1),
|
||||||
sub(["highlight", __], 0, 1)]);
|
sub(["highlight", __], 0, 1)]);
|
||||||
},
|
},
|
||||||
|
@ -44,6 +44,8 @@ function spawnGui() {
|
||||||
World.send(["fieldCommand", "cursorLeft"]);
|
World.send(["fieldCommand", "cursorLeft"]);
|
||||||
} else if (keycode === 39 /* right */) {
|
} else if (keycode === 39 /* right */) {
|
||||||
World.send(["fieldCommand", "cursorRight"]);
|
World.send(["fieldCommand", "cursorRight"]);
|
||||||
|
} else if (keycode === 9 /* tab */) {
|
||||||
|
// ignore
|
||||||
} else if (keycode === 8 /* backspace */) {
|
} else if (keycode === 8 /* backspace */) {
|
||||||
World.send(["fieldCommand", "backspace"]);
|
World.send(["fieldCommand", "backspace"]);
|
||||||
} else if (character) {
|
} else if (character) {
|
||||||
|
@ -112,8 +114,7 @@ function spawnSearch() {
|
||||||
World.updateRoutes(this.subscriptions());
|
World.updateRoutes(this.subscriptions());
|
||||||
},
|
},
|
||||||
subscriptions: function () {
|
subscriptions: function () {
|
||||||
return [sub(["jQuery", "#searchBox", "+keypress", __]),
|
return [sub(["jQuery", "#searchBox", "input", __]),
|
||||||
sub(["jQuery", "#searchBox", "change", __]),
|
|
||||||
sub(["fieldContents", __, __], 0, 1),
|
sub(["fieldContents", __, __], 0, 1),
|
||||||
pub(["highlight", this.highlight])];
|
pub(["highlight", this.highlight])];
|
||||||
},
|
},
|
||||||
|
@ -142,7 +143,7 @@ function spawnSearch() {
|
||||||
this.search();
|
this.search();
|
||||||
break;
|
break;
|
||||||
case "message":
|
case "message":
|
||||||
if (e.message[0] === "jQuery") { // it's a search box change or keypress
|
if (e.message[0] === "jQuery") { // it's a search box input event
|
||||||
this.search();
|
this.search();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue