From 22a70d26082fe6955e09ec1c87b70dd679ae9412 Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 22 Mar 2011 15:17:48 +0000 Subject: [PATCH] minibar: don't force focus to the typed input field after every word On touch-based devices, the on-screen keyboard kept popping up after every word, which was very annoying if you were entering a sentence by tapping on the magnets. --- src/runtime/javascript/minibar/minibar.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/runtime/javascript/minibar/minibar.js b/src/runtime/javascript/minibar/minibar.js index 3ed0d99e1..83cf7d5d1 100644 --- a/src/runtime/javascript/minibar/minibar.js +++ b/src/runtime/javascript/minibar/minibar.js @@ -244,18 +244,16 @@ Minibar.prototype.target_lang=function() { Minibar.prototype.add_typed_input=function() { with(this) { - var inp; - if(surface.typed) inp=surface.typed; - else { - inp=empty("input","type","text"); + if(!surface.typed) { + var inp=empty("input","type","text"); inp.value=""; inp.setAttribute("accesskey","t"); inp.style.width="10em"; inp.onkeyup=bind(complete_typed,this); surface.appendChild(inp); surface.typed=inp; + inp.focus(); } - inp.focus(); } }