diff options
| author | hallgren <hallgren@chalmers.se> | 2011-03-22 15:17:48 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2011-03-22 15:17:48 +0000 |
| commit | 17f3b456ce77369666c4e5de5aefbfb2ee961423 (patch) | |
| tree | c6b3e60f72892135eb994236e597aabc2102c0a8 /src/runtime | |
| parent | 5c7ebcc511ef04291006bd4767351ba744351a1d (diff) | |
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.
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/javascript/minibar/minibar.js | 8 |
1 files 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(); } } |
