Original source (on modern site)
';
if (results[d]['objectType'] == 'article') {
ht+= ' ' + timeAgo(results[d]['date'], 'nl') + ' ';
}
if (results[d]['objectType'] == 'coureur') {
ht+= ' Coureur, ' + results[d]['subtitle'] + ' ';
}
ht+= ' ';
ht+= '';
//console.log(ht);
$("#searchResults").append(ht);
fndResults = 1;
}
i++;
}
}
if (fndResults == 1) { //RESULTATEN GEVONDEN
$("#searchResults").show();
}
}
});
}
lastVal = val; //LAST VALUE
}
}
$( document ).ready(function() {
$("#search_2021_window").show();
$(".top-header-bar .search_2021").click(function(){
if ($(".navigation").hasClass("activeSearch")){
$(".navigation").removeClass("activeSearch");
$(".search_2021").removeClass("activeSearch");
if ($(document).width() <= 768){
$("body").css("overflow","auto");
}
} else {
$(".navigation").addClass("activeSearch");
$(".search_2021").addClass("activeSearch");
setTimeout(function() {
$("#search_2021_window .searchbx input").focus();
$("#searchResults").html("");
$("#searchResults").hide();
lastVal = "";
}, 200);
}
});
//SEARCH
$("#search_2021_window input").keyup(delay(function (e) {
replQuotes = $(this).val();
activateSearch2(replQuotes);
}, 300));
$(".searchbx input").click(function() {
replQuotes = $(this).val();
activateSearch2(replQuotes);
});
//KEY DOWN EN TABS
$('#search_2021_window input').on('keydown', function(event) {
//console.log("GOOO ENTERRR: " + event.which + " -- " + event.keyCode);
if (event.which === 13) { //enter key down
//PREVENT
//if([38, 40, 9].indexOf(event.keyCode) > -1) {
//event.preventDefault();
//handleEventKey(event);
//console.log("GOOO ENTERRR 2");
//alert("ZOExxK!");
//replQuotes = $("#search_2021_window input").val();
//alert("FIND: " + replQuotes);
//activateSearch2(replQuotes);
//} else {
//}
}
})
//MOBILE
if ($(document).width() <= 768){
$("#search_2021_window .back").click(function() {
$(".navigation").removeClass("activeSearch");
$(".search_2021").removeClass("activeSearch");
});
$("#search_2021_window .cross").click(function() {
$("#search_2021_window .searchbx input").val("");
setTimeout(function() {
$("#search_2021_window .searchbx input").focus();
$("#searchResults").html("");
$("#searchResults").hide();
lastVal = "";
}, 200);
});
}
});
$(document).mouseup(function(e)
{
var containerVisSearch = $(".top-header-bar");
// if the target of the click isn't the container nor a descendant of the container
if (!containerVisSearch.is(e.target) && containerVisSearch.has(e.target).length === 0)
{
$("#searchResults").html("");
$("#searchResults").hide();
$(".top-header-bar .navigation").removeClass("activeSearch");
$(".top-header-bar .search_2021").removeClass("activeSearch");
if ($(document).width() <= 768){
$("body").css("overflow","auto");
}
//setTimeout(function() {
// $("#search_2021_window input").val("");
lastVal = "";
//}, 100);
}
});
Ben je een F1 fan? Volg GPFans. Editie