Changeset - f0e518891d69
[Not reviewed]
Mads Kiilerich - 11 years ago 2014-07-03 01:03:27
madski@unity3d.com
rhodecode.js: break the loop when fileBrowserListeners search is truncated
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/js/rhodecode.js
Show inline comments
 
@@ -914,24 +914,25 @@ var fileBrowserListeners = function(curr
 
                        }
 

	
 
                        var n = nodes[i].name;
 
                        var t = nodes[i].type;
 
                        var n_hl = n.substring(0,pos)
 
                          +"<b>{0}</b>".format(n.substring(pos,pos+query.length))
 
                          +n.substring(pos+query.length)
 
                        var new_url = url_base.replace('__FPATH__',n);
 
                        match.push('<tr><td><a class="browser-{0}" href="{1}">{2}</a></td><td colspan="5"></td></tr>'.format(t,new_url,n_hl));
 
                    }
 
                    if(match.length >= matches_max){
 
                        match.push('<tr><td>{0}</td><td colspan="5"></td></tr>'.format(_TM['Search truncated']));
 
                        break;
 
                    }
 
                }
 
            }
 
            if(query != ""){
 
                $('#tbody').hide();
 
                $('#tbody_filtered').show();
 

	
 
                if (match.length==0){
 
                  match.push('<tr><td>{0}</td><td colspan="5"></td></tr>'.format(_TM['No matching files']));
 
                }
 

	
 
                $('#tbody_filtered').html(match.join(""));
0 comments (0 inline, 0 general)