mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Clickthrough on main when blur, and fixed search add bug
This commit is contained in:
38
js/search.js
38
js/search.js
@@ -27,6 +27,7 @@ $(document).ready(function()
|
||||
}else if(event.keyCode == 27){
|
||||
$("#results").html("");
|
||||
$(".main").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
}else{
|
||||
i = 0;
|
||||
timer=100;
|
||||
@@ -67,6 +68,7 @@ $(document).keyup(function(e) {
|
||||
document.getElementById("search").value = "";
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -103,7 +105,7 @@ function search(search_input){
|
||||
<img src='"+video_thumb+"' class='thumb'>\
|
||||
<div id='title'>"+data.title+"\
|
||||
<div class='result_info'>"+views+" views • "+length+"</div>\
|
||||
<input id='add' title='Add several songs' type='button' class='button' value='+' onclick=\"submit('"+data.id+"','"+video_title+"');\">\
|
||||
<input id='add' title='Add several songs' type='button' class='button' value='+' onclick=\"submit('"+data.id+"','"+video_title+"', false);\">\
|
||||
</div>\
|
||||
</div>";
|
||||
//+data.uploader+" • "+
|
||||
@@ -117,6 +119,7 @@ function search(search_input){
|
||||
{
|
||||
$(".main").addClass("blurT");
|
||||
$("#controls").addClass("blurT");
|
||||
$(".main").addClass("clickthrough");
|
||||
}
|
||||
|
||||
$("<div id='r' style='display:none;'>"+wrapper+"</div>").appendTo('#results').slideDown('slow');
|
||||
@@ -129,18 +132,19 @@ function search(search_input){
|
||||
}else{
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function submitAndClose(id,title){
|
||||
submit(id,title);
|
||||
submit(id,title, true);
|
||||
$("#results").html('');
|
||||
console.log("sub&closed");
|
||||
|
||||
}
|
||||
|
||||
function submit(id,title){
|
||||
function submit(id,title,type){
|
||||
|
||||
serverAns = $.ajax({
|
||||
type: "GET",
|
||||
@@ -148,21 +152,27 @@ function submit(id,title){
|
||||
async: false,
|
||||
data: "v="+id+"&n="+title+"&pass="+adminpass,
|
||||
success: function() {
|
||||
|
||||
document.getElementById("search").value = "";
|
||||
$("#results").html = "";
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
if(type){
|
||||
document.getElementById("search").value = "";
|
||||
$("#results").html = "";
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
}
|
||||
//$("#search").addClass("success");
|
||||
},
|
||||
error: function(){
|
||||
|
||||
|
||||
console.log("error in adding");
|
||||
document.getElementById("search").value = "";
|
||||
$("#results").html = "";
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$("#search").addClass("error");
|
||||
if(type)
|
||||
{
|
||||
document.getElementById("search").value = "";
|
||||
$("#results").html = "";
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
$("#search").addClass("error");
|
||||
}
|
||||
}
|
||||
}).responseText;
|
||||
|
||||
|
||||
@@ -93,6 +93,8 @@ input[type="radio"]{display: none;}
|
||||
.toggtext{display: inline;}
|
||||
.adminBox{float:right;}
|
||||
|
||||
.clickthrough{pointer-events: none;}
|
||||
|
||||
#adminPanel{border-bottom: none; color:white; height:190px; padding: 10px; overflow:hidden; background-color: rgba(0,0,0,0.2); transition: height 0.5s;}
|
||||
.hiddenAdmin{padding:0 !important; margin:0 !important; height: 0 !important;}
|
||||
.button{background-color: rgba(255,255,255,0.2); border-radius: 4px; border: none;color: white;padding: 5px 15px; margin-top: 15px; transition: all 0.1s ease-in-out;}
|
||||
|
||||
Reference in New Issue
Block a user