52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
$(document).ready(function() {
|
|
var searchbox;
|
|
|
|
$("#global_live_search").click(function() {
|
|
if($(this).val() == 'Suche') {
|
|
$(this).val('');
|
|
}
|
|
});
|
|
|
|
$("#global_live_search").focusout(function() {
|
|
if($(this).val() == '') {
|
|
$(this).val('Suche');
|
|
}
|
|
});
|
|
|
|
$("#global_live_search").live('keyup', function(e) {
|
|
e.preventDefault();
|
|
|
|
var search = $(this).val();
|
|
|
|
if (search.length > 2) {
|
|
var jqxhr = $.ajax({
|
|
'url': 'index.php?admin_modul=admin_search&mod=json&search=' + encodeURIComponent(search)
|
|
});
|
|
|
|
jqxhr.success(function(data){
|
|
$('#searchResultBox').empty().remove();
|
|
$('#global_live_search').css('z-index','99999');
|
|
var height = $('body').css('height');
|
|
$('#OverlayPixl').css('height',height);
|
|
searchbox = $('<div id="searchResultBox" style="z-index:102;"></div>')
|
|
.appendTo('#bodycontainer')
|
|
.append(data);
|
|
});
|
|
|
|
jqxhr.error(function(data) {
|
|
alert(data);
|
|
});
|
|
} else {
|
|
|
|
$('#searchResultBox').empty().remove();
|
|
$('#global_live_search').css('z-index','101');
|
|
}
|
|
});
|
|
|
|
$('#OverlayPixl').click(function(){
|
|
$('#searchResultBox').empty().remove();
|
|
$('#global_live_search').css('z-index','101');
|
|
$(this).css('height','0px');
|
|
});
|
|
|
|
}); |