mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-29 05:21:01 +00:00
Fixed errors with keydown and keyup on desktop
This commit is contained in:
@@ -266,9 +266,8 @@ $(document).on("click", "#chat-btn", function(){
|
||||
$("#favicon").attr("href", "static/images/favicon.png");
|
||||
});
|
||||
|
||||
$(document).on('keydown', ".search_input", function(event) {
|
||||
|
||||
search_input = $(this).val();
|
||||
function searchTimeout(event) {
|
||||
search_input = $(".search_input").val();
|
||||
|
||||
code = event.keyCode || event.which;
|
||||
|
||||
@@ -286,9 +285,17 @@ $(document).on('keydown', ".search_input", function(event) {
|
||||
timer=100;*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
if(/iPad|iPhone|iPod/.test(navigator.userAgent)){
|
||||
$document.on('keydown', '.search_input', function(event) {
|
||||
searchTimeout(event);
|
||||
});
|
||||
} else {
|
||||
$(document).on('keyup', ".search_input", function(event) {
|
||||
searchTimeout(event);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on("click", ".chat-tab", function(){
|
||||
$("#text-chat-input").focus();
|
||||
|
||||
@@ -24,7 +24,6 @@ var Search = {
|
||||
if(window.search_input !== ""){
|
||||
searching = true;
|
||||
var keyword= encodeURIComponent(window.search_input);
|
||||
|
||||
//response= x
|
||||
var yt_url = "https://www.googleapis.com/youtube/v3/search?key="+api_key+"&videoEmbeddable=true&part=id&fields=items(id)&type=video&order=viewCount&safeSearch=none&maxResults=25";
|
||||
yt_url+="&q="+keyword;
|
||||
|
||||
Reference in New Issue
Block a user