mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-13 04:15:11 +00:00
Monotone-Parent: d6acf550ed6a03fbd33942b8d7cd672e30a07bf0
Monotone-Revision: 4e2e4e4ad21a011b6ad424ad6c61413fb2972b15 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-03-09T13:45:19 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -916,23 +916,28 @@ function onSearchBlur(event) {
|
||||
}
|
||||
}
|
||||
|
||||
function onSearchKeyDown(event) {
|
||||
if (event.keyCode == Event.KEY_TAB
|
||||
|| event.ctrlKey
|
||||
|| event.metaKey)
|
||||
return false;
|
||||
|
||||
if (this.timer)
|
||||
clearTimeout(this.timer);
|
||||
function IsCharacterKey(keyCode) {
|
||||
return (keyCode == 32 /* space */
|
||||
|| (keyCode > 47 && keyCode < 58) /* digits */
|
||||
|| (keyCode > 64 && keyCode < 91) /* letters */
|
||||
|| (keyCode > 95 && keyCode < 112) /* numpad digits */
|
||||
|| (keyCode > 186 && keyCode < 193)
|
||||
|| (keyCode > 218 && keyCode < 223))
|
||||
}
|
||||
|
||||
function onSearchKeyDown(event) {
|
||||
if (event.keyCode == Event.KEY_RETURN) {
|
||||
if (this.timer)
|
||||
clearTimeout(this.timer);
|
||||
onSearchFormSubmit();
|
||||
preventDefault(event);
|
||||
}
|
||||
else if (event.keyCode == 0
|
||||
|| event.keyCode == Event.KEY_BACKSPACE
|
||||
|| event.keyCode > 31)
|
||||
else if (event.keyCode == Event.KEY_BACKSPACE
|
||||
|| IsCharacterKey(event.keyCode)) {
|
||||
if (this.timer)
|
||||
clearTimeout(this.timer);
|
||||
this.timer = setTimeout("onSearchFormSubmit()", 500);
|
||||
}
|
||||
}
|
||||
|
||||
function onSearchFormSubmit(event) {
|
||||
|
||||
Reference in New Issue
Block a user