Permalink
Browse files

select word in text field after 5 seconds instead of removing word.

git-svn-id: svn+ssh://torus.jp/home/toru/svn/misc/webdict@69 1f37519a-7ad4-497f-bc20-5d7ca8e04135
  • Loading branch information...
1 parent 9bb9a0d commit d05d9662f0397da83b738ba542ba5eeb8010a215 toru committed May 14, 2009
Showing with 8 additions and 5 deletions.
  1. +8 −5 index.html
View
@@ -36,6 +36,8 @@
var changed = false;
return function () {
+ document.getElementById ("word").focus ();
+
var text = document.getElementById ("word").value.toLowerCase();
if (text.length > 0) {
@@ -58,11 +60,12 @@
httpObj.send (null);
} else {
document.getElementById ("debug").innerHTML = idlecount;
- if (idlecount ++ > 5) {
- document.getElementById ("word").value = "";
-// document.getElementById ("wordform").reset ();
- idlecount = 0;
- }
+ if (idlecount > 5) {
+ var text = document.getElementById ("word");
+ text.focus ();
+ text.select ();
+ } else
+ idlecount ++;
}
}
};

0 comments on commit d05d966

Please sign in to comment.