1
1
Fork 0
friendica_2019-12_sharedHos.../templates/contacts-head.tpl
rabuzarus 17958da201 introduce a filter function at the contact page.
This is done with the help of textcomplete and jsmart.js.
There is annoying bug inside. If the screensize is to small, the browser freezes. It is traced back to the "media-body" class (and its css attributes) which we use in the template.
2016-04-28 21:35:33 +02:00

24 lines
660 B
Smarty

<script>
$(document).ready(function() {
// Add contact_filter autocompletion to the search field
$("#contacts-search").contact_filter(baseurl + '/acl', 'r', true);
// Hide the viewcontact_wrapper if there is an input in the search field
// We are doing this to let the the contact_filter replace the original
// shown contacts
$("#contacts-search").keyup(function(){
var elText = $(this).val();
if(elText.length !== 0) {
$("#viewcontact_wrapper").hide();
$("ul.textcomplete-dropdown").addClass("show media-list");
} else {
$("#viewcontact_wrapper").show();
$("ul.textcomplete-dropdown").removeClass("show");
}
});
});
</script>