mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-05 02:19:43 +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:
@@ -1,3 +1,14 @@
|
||||
2010-03-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/UIxContactsUserFolders.js
|
||||
(onFolderSearchKeyDown): same as below.
|
||||
|
||||
* UI/WebServerResources/generic.js (IsCharacterKey): new helper
|
||||
function that returns whether the pressed keycode is one that
|
||||
changes the content of input fields.
|
||||
(onSearchKeyDown): simplified method by making use of the new
|
||||
function above.
|
||||
|
||||
2010-03-08 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/generic.js (onSearchKeyDown): set the
|
||||
|
||||
@@ -231,22 +231,20 @@ function onConfirmFolderSelection(event) {
|
||||
}
|
||||
|
||||
function onFolderSearchKeyDown(event) {
|
||||
if (event.ctrlKey
|
||||
|| event.metaKey
|
||||
|| event.keyCode == Event.KEY_TAB)
|
||||
return;
|
||||
|
||||
var div = $("folders");
|
||||
if (event.keyCode == Event.KEY_BACKSPACE
|
||||
|| IsCharacterKey(event.keyCode)) {
|
||||
var div = $("folders");
|
||||
|
||||
if (!div.clean) {
|
||||
var oldD = $("d"); // the folders tree
|
||||
if (oldD) {
|
||||
oldD.remove();
|
||||
delete d;
|
||||
}
|
||||
div.clean = true;
|
||||
$("addButton").addClassName("disabled");
|
||||
}
|
||||
if (!div.clean) {
|
||||
var oldD = $("d"); // the folders tree
|
||||
if (oldD) {
|
||||
oldD.remove();
|
||||
delete d;
|
||||
}
|
||||
div.clean = true;
|
||||
$("addButton").addClassName("disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initUserFoldersWindow() {
|
||||
|
||||
@@ -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