Improved JavaScript of UIxContactsUserFolders to avoid useless AJAX requests.

Monotone-Parent: 23831e953238f691f5c6c210b4ddec5d7aee5aec
Monotone-Revision: a62454d2734ee40074efa8872c2a7dfef7bf59fc

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-09-04T21:32:53
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2009-09-04 21:32:53 +00:00
parent 1bd01c2ce0
commit d8be5f7ddb
3 changed files with 29 additions and 21 deletions

View File

@ -1,11 +1,11 @@
DIV#filterPanel
{ position: absolute;
{ position: absolute; n0border: 1px dotted blue;
text-align: center;
width: auto;
line-height: 3em;
n0line-height: 3em;
top: 0;
left: 1em;
right: 1em; }
left: 0;
padding: 3px 1em 0; }
SPAN.searchBox
{ float: none !important; }

View File

@ -24,14 +24,14 @@ function onSearchFormSubmit() {
}
function usersSearchCallback(http) {
document.userFoldersRequest = null;
var div = $("folders");
if (http.status == 200) {
var response = http.responseText;
buildUsersTree(div, http.responseText)
}
else if (http.status == 404)
div.update();
document.userFoldersRequest = null;
var div = $("folders");
if (http.status == 200) {
var response = http.responseText;
buildUsersTree(div, http.responseText);
}
else if (http.status == 404)
div.update();
}
function addUserLineToTree(tree, parent, line) {
@ -223,20 +223,25 @@ function onConfirmFolderSelection(event) {
}
function onFolderSearchKeyDown(event) {
if (event.ctrlKey
|| event.metaKey
|| event.keyCode == Event.KEY_TAB)
return;
var div = $("folders");
if (!div.clean) {
var oldD = $("d");
if (oldD) {
oldD.remove();
delete d;
}
div.clean = true;
$("addButton").disabled = true;
var oldD = $("d"); // the folders tree
if (oldD) {
oldD.remove();
delete d;
}
div.clean = true;
$("addButton").disabled = true;
}
if (this.timer)
startAnimation($("pageContent"), $("filterPanel"));
startAnimation($("pageContent"), $("filterPanel"));
}
function initUserFoldersWindow() {

View File

@ -939,6 +939,9 @@ function onSearchBlur(event) {
}
function onSearchKeyDown(event) {
if (event.keyCode == Event.KEY_TAB)
return false;
if (this.timer)
clearTimeout(this.timer);