Made the search form lives

This commit is contained in:
Pierre 2018-01-02 19:07:18 +01:00
parent 3c803a16c0
commit 97fd4e5ce4
2 changed files with 24 additions and 1 deletions

View File

@ -5,6 +5,12 @@
*/
ComunicWeb.components.searchForm = {
/**
* Store the text input area
*/
_textInput: null,
/**
* Initializate a search form element
*
@ -42,6 +48,9 @@ ComunicWeb.components.searchForm = {
ComunicWeb.components.searchForm.ontextchange(textInput, searchResultBox, searchBoxContainer, footerLink);
}
//Cache textinput area
this._textInput = textInput;
return true;
},
@ -140,5 +149,19 @@ ComunicWeb.components.searchForm = {
//Apply user informations
userImage.src = userInfos.accountImage;
usernameElem.innerHTML = userInfos.firstName + " " + userInfos.lastName;
//Make user link element live
userLinkElement.onclick = function() {
ComunicWeb.components.searchForm.close();
openUserPage(userIDorPath(userInfos));
}
},
/**
* Close and clear the search form
*/
close: function(){
this._textInput.value = "";
this._textInput.onkeyup();
}
}

View File

@ -256,7 +256,7 @@ ComunicWeb.user.userInfos = {
getIDorPath: function(userInfos){
//Check if a virtual directory is available
if(userInfos.virtualDirectory != null){
if(userInfos.virtualDirectory != null && userInfos.virtualDirectory != ""){
return userInfos.virtualDirectory;
}