Improved UIxContactsUserFolders
Monotone-Parent: 69aea51b0d7ecf49944b3cbfb0693ab21303c715 Monotone-Revision: b917f2afae3c6e2c7a99f4406fd78c09462e37b1 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-06-15T15:58:47 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
dbd90b1f58
commit
dd543d934e
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
|
||||
<div id="filterPanel">
|
||||
<span class="searchBox" style="float: right">
|
||||
<span class="searchBox" style="float: right;">
|
||||
<input id="searchCriteria" name="criteria" type="hidden" var:value="searchCriteria" />
|
||||
<input id="searchValue" class="textField" autocomplete="off" name="search"
|
||||
menuid="searchMenu"
|
||||
|
|
|
@ -6,6 +6,10 @@ function onSearchFormSubmit() {
|
|||
var searchValue = $("searchValue");
|
||||
var encodedValue = encodeURI(searchValue.value);
|
||||
|
||||
if (encodedValue.blank()) {
|
||||
checkAjaxRequestsState();
|
||||
}
|
||||
else {
|
||||
var url = (UserFolderURL
|
||||
+ "usersSearch?search=" + encodedValue);
|
||||
if (document.userFoldersRequest) {
|
||||
|
@ -14,6 +18,7 @@ function onSearchFormSubmit() {
|
|||
}
|
||||
document.userFoldersRequest
|
||||
= triggerAjaxRequest(url, usersSearchCallback);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -218,7 +223,8 @@ function onConfirmFolderSelection(event) {
|
|||
|
||||
function onFolderSearchKeyDown(event) {
|
||||
var div = $("folders");
|
||||
if (!div.clean && (event.keyCode == 8 || event.keyCode >31)) {
|
||||
|
||||
if (!div.clean) {
|
||||
var oldD = $("d");
|
||||
if (oldD) {
|
||||
oldD.remove();
|
||||
|
@ -226,8 +232,10 @@ function onFolderSearchKeyDown(event) {
|
|||
}
|
||||
div.clean = true;
|
||||
$("addButton").disabled = true;
|
||||
startAnimation($("pageContent"), $("filterPanel"));
|
||||
}
|
||||
|
||||
if (this.timer)
|
||||
startAnimation($("pageContent"), $("filterPanel"));
|
||||
}
|
||||
|
||||
function initUserFoldersWindow() {
|
||||
|
|
|
@ -985,7 +985,7 @@ function onSearchFocus() {
|
|||
}
|
||||
|
||||
function onSearchBlur(event) {
|
||||
if (!this.value || this.value.strip().length == 0) {
|
||||
if (!this.value || this.value.blank()) {
|
||||
this.setAttribute("modified", "");
|
||||
this.setStyle({ color: "#aaa" });
|
||||
this.value = this.ghostPhrase;
|
||||
|
@ -1007,12 +1007,15 @@ function onSearchKeyDown(event) {
|
|||
if (this.timer)
|
||||
clearTimeout(this.timer);
|
||||
|
||||
if (event.keyCode == 13) {
|
||||
if (event.ctrlKey || event.metaKey)
|
||||
return;
|
||||
else if (event.keyCode == Event.KEY_RETURN) {
|
||||
onSearchFormSubmit();
|
||||
preventDefault(event);
|
||||
}
|
||||
else if (event.keyCode == 8
|
||||
|| event.keyCode >31)
|
||||
else if (event.keyCode == 0
|
||||
|| event.keyCode == Event.KEY_BACKSPACE
|
||||
|| event.keyCode > 31)
|
||||
this.timer = setTimeout("onSearchFormSubmit()", 1000);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue