diff --git a/rhodecode/public/js/rhodecode.js b/rhodecode/public/js/rhodecode.js --- a/rhodecode/public/js/rhodecode.js +++ b/rhodecode/public/js/rhodecode.js @@ -418,6 +418,11 @@ var fileBrowserListeners = function(curr nodes = JSON.parse(o.responseText); YUD.setStyle('node_filter_box_loading','display','none'); YUD.setStyle('node_filter_box','display',''); + n_filter.focus(); + if(YUD.hasClass(n_filter,'init')){ + n_filter.value = ''; + YUD.removeClass(n_filter,'init'); + } }, failure:function(o){ console.log('failed to load'); @@ -430,13 +435,14 @@ var fileBrowserListeners = function(curr return function(){ // Reset timeout F.filterTimeout = null; - var query = e.target.value; + var query = e.target.value.toLowerCase(); var match = []; var matches = 0; var matches_max = 20; if (query != ""){ for(var i=0;i{0}".format(n.substring(pos,pos+query.length)) +n.substring(pos+query.length) - match.push('{1}'.format(node_url.replace('__FPATH__',n),n_hl)); + match.push('{2}'.format(t,node_url.replace('__FPATH__',n),n_hl)); } if(match.length >= matches_max){ match.push('{0}'.format(truncated_lbl)); @@ -479,7 +486,10 @@ var fileBrowserListeners = function(curr F.initFilter(); }) YUE.on(n_filter,'click',function(){ - n_filter.value = ''; + if(YUD.hasClass(n_filter,'init')){ + n_filter.value = ''; + YUD.removeClass(n_filter,'init'); + } }); YUE.on(n_filter,'keyup',function(e){ clearTimeout(F.filterTimeout);