mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	Fixed the brightness errors on finding song
This commit is contained in:
		@@ -38,7 +38,9 @@ function updateList()
 | 
			
		||||
		$.each(list.songs, function(j, listeID){
 | 
			
		||||
			var video_title=listeID.title.replace(/\\\'/g, "'").replace(/"/g,"'").replace(/&/g,"&");
 | 
			
		||||
			var video_id = listeID.id;
 | 
			
		||||
			if(find && video_id != bright) brightness = "brightness";
 | 
			
		||||
			console.log($.inArray(video_id, bright));
 | 
			
		||||
			if(find && $.inArray(video_id, bright) == -1) brightness = "brightness";
 | 
			
		||||
			else if(find && $.inArray(video_id, bright) != -1) brightness = "brightness fullbrightness";
 | 
			
		||||
			else brightness = "";
 | 
			
		||||
			var video_thumb = "http://i.ytimg.com/vi/"+video_id+"/mqdefault.jpg";
 | 
			
		||||
			var odd = ""; if(j%2===0)odd=" oddlist";
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
$(document).ready(function()
 | 
			
		||||
{
 | 
			
		||||
	found = null;
 | 
			
		||||
	bright = "";
 | 
			
		||||
	bright = [];
 | 
			
		||||
	$.expr[":"].contains = $.expr.createPseudo(function(arg) {
 | 
			
		||||
    return function( elem ) {
 | 
			
		||||
	        return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
 | 
			
		||||
@@ -18,6 +18,7 @@ $(document).ready(function()
 | 
			
		||||
			{
 | 
			
		||||
				$(".lresult").removeClass("brightness");
 | 
			
		||||
				$(".lresult").removeClass("fullbrightness");
 | 
			
		||||
				bright.length = 0;
 | 
			
		||||
			}
 | 
			
		||||
        	event.preventDefault();
 | 
			
		||||
        	$("#findform").toggleClass("display");
 | 
			
		||||
@@ -65,28 +66,23 @@ $(document).ready(function()
 | 
			
		||||
    		{
 | 
			
		||||
	    		last = found[0];
 | 
			
		||||
	    		if(!(typeof last === "undefined"))
 | 
			
		||||
	    		{
 | 
			
		||||
		    		//last.style.backgroundColor = "none";
 | 
			
		||||
		    		$(".lresult").removeClass("fullbrightness");
 | 
			
		||||
		    		//last.className = last.className + " brightness";
 | 
			
		||||
		    	}
 | 
			
		||||
	    	}
 | 
			
		||||
    		found = $("#wrapper").find(".lresult:contains('"+$("#findform-input").val()+"')");
 | 
			
		||||
    		if(found != "" && $("#findform-input").val() != "")
 | 
			
		||||
    		{
 | 
			
		||||
    			//found[0].style.backgroundColor = "rgba(0,0,0,0.5)";
 | 
			
		||||
    			//found[0].setAttribute("style", "-webkit-filter:brightness(100%)");
 | 
			
		||||
    			for(i = 0; i < found.length; i++)
 | 
			
		||||
    			{
 | 
			
		||||
	    			found[i].className = found[i].className + " fullbrightness";
 | 
			
		||||
	    			bright = found[i].className.split(" ")[i];
 | 
			
		||||
	    			console.log(found[i].className.split(" ")[0]);
 | 
			
		||||
	    			bright.push(found[i].className.split(" ")[0]);
 | 
			
		||||
	    			//bright.push(found[i].className.split(" ")[0]);
 | 
			
		||||
    			}
 | 
			
		||||
    			//found[0].style.backgroundColor = "red";
 | 
			
		||||
    			myScroll.scrollToElement(found[0], 10, 0, -40);
 | 
			
		||||
    		}else
 | 
			
		||||
    		{
 | 
			
		||||
    			$(".lresult").removeClass("fullbrightness");
 | 
			
		||||
    			bright = "";
 | 
			
		||||
    			bright.length = 0;
 | 
			
		||||
    		}
 | 
			
		||||
    		//console.log($("#wrapper").find(".result:contains('"+$("#findform-input").val()+"')"));
 | 
			
		||||
    	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user