From c8a1bf4fce7a154890e4f1edfe893e2601c2934c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 19 Jun 2011 23:17:55 +0100 Subject: [PATCH] Have views redrawn in keyboard handlers if content has changed. --- src/ui/Key.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ui/Key.js b/src/ui/Key.js index 8e2962cd..858ca537 100644 --- a/src/ui/Key.js +++ b/src/ui/Key.js @@ -69,7 +69,8 @@ var Key = this.Key = new function() { var character = String.fromCharCode(charCode), key = keys[keyCode] || character.toLowerCase(), handler = down ? 'onKeyDown' : 'onKeyUp', - scope = View.focused && View.focused._scope, + view = View.focused, + scope = view && view._scope, tool = scope && scope.tool; keyMap[key] = down; if (tool && tool[handler]) { @@ -80,6 +81,8 @@ var Key = this.Key = new function() { var keyEvent = new KeyEvent(down, key, character, event); if (tool[handler](keyEvent) === false) keyEvent.preventDefault(); + if (view) + view.draw(true); } }