Skip to content

Commit

Permalink
Changes the timing of removing top 10
Browse files Browse the repository at this point in the history
  • Loading branch information
apsdehal committed Feb 22, 2014
1 parent 7b734db commit 2847903
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions public/js/main.js
Expand Up @@ -11,23 +11,26 @@ if(window.location.pathname !== "/queue") {

$.getJSON('/config.json',function(config){
$("#searchbox").bind('keydown',function(e){
//
$('#_1').remove();
$('#_2').remove();
$('#_3').remove();
$('#_4').remove();
$('.hr').remove();

//Bind the enter key to the handler
if(e.keyCode===13){

//Remove only if enter key has been smashed!
$('#_1').remove();
$('#_2').remove();
$('#_3').remove();
$('#_4').remove();
$('.hr').remove();

var text=this.value;

if(text.substr(0,4)==="http"){
//We have a youtube link for us
$.post('/youtube',{link:text});
//Empty the search box if its youtube link
this.value = '';

}
else{
else {
$.get(config.muzi_root+"ajax/search/",{search:text},function(data){
// removing old data to show new
$('#alert').remove();
Expand Down

0 comments on commit 2847903

Please sign in to comment.