Remove search field on group button

Hide the search bar when showing the groups listed for a user, and resotre it when doing other searches.

The enroll button is added only on the groups page, and removed along with anything else in the searchButtons div when a new search is started.
This commit is contained in:
Adam Young 2010-08-06 15:09:29 -04:00
parent 8ad88b4119
commit b192bb76d0
3 changed files with 8 additions and 7 deletions

View File

@ -49,8 +49,8 @@
</div>
<div id="search" style="visibility:hidden">
<div class="searchControls" >
<span class="filter" >
<div id="searchControls" class="searchControls" >
<span id="filter" class="filter" >
<input id="queryFilter" type="text"/>
<input id="query" type="submit" value="find" />
<input id="new" type="submit" value="new" />

View File

@ -15,6 +15,9 @@ function showSearch(){
$('#content').css("visibility","hidden");
$('#search').css("display","block");
$('#content').css("display","none");
$("#filter").css("display","block");
$("#searchButtons").html("");
}

View File

@ -66,7 +66,7 @@ function renderUserLinks(current, cell){
}).appendTo(cell);
$("<a/>",{
href: "#tab=user&facet=details&pkey="+current.uid,
href: "#?tab=user&facet=group&pkey="+current.uid,
click:setupUserGroupMembership,
html: "[G]"
}).appendTo(cell);
@ -243,16 +243,14 @@ function populateUserEnrollments(userData){
function setupUserGroupMembership(){
$("#searchButtons").html("");
showSearch();
$("#filter").css("display","none");
$("<input/>",{
type: 'button',
value: 'enroll',
click: setupUserGroupEnrollmentSearch
}).appendTo("#searchButtons");
showSearch();
var columnHeaders = document.createElement("tr");
for (var i =0 ; i != groupMembershipColumns.length ;i++){
var th = document.createElement("th");