diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-06-22 17:43:57 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-06-22 20:31:59 +0200 |
commit | f4b937c6fe325b1ad8bceb7ceba69a9a8a068bcd (patch) | |
tree | 08dd1a98bad643289962459ddb045ac2b8d4c038 /search/js/result.js | |
parent | 618a3c1d94980ab6de8eadc0a491cd324cea2285 (diff) | |
download | nextcloud-server-f4b937c6fe325b1ad8bceb7ceba69a9a8a068bcd.tar.gz nextcloud-server-f4b937c6fe325b1ad8bceb7ceba69a9a8a068bcd.zip |
Simplify search result js code
Diffstat (limited to 'search/js/result.js')
-rw-r--r-- | search/js/result.js | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/search/js/result.js b/search/js/result.js index 1087f9684b2..27a2383e2c3 100644 --- a/search/js/result.js +++ b/search/js/result.js @@ -41,23 +41,13 @@ OC.search.showResults=function(results){ for(var name in types){ var type=types[name]; if(type.length>0){ - var row=$('#searchresults tr.template').clone(); - row.removeClass('template'); - row.addClass('result'); - row.children('td.type').text(name); - row.find('td.result a').attr('href',type[0].link); - row.find('td.result div.name').text(type[0].name); - row.find('td.result div.text').text(type[0].text); - row.data('index',index); - index++; - if(OC.search.customResults[name]){//give plugins the ability to customize the entries in here - OC.search.customResults[name](row,type[0]); - } - $('#searchresults tbody').append(row); - for(var i=1;i<type.length;i++){ + for(var i=0;i<type.length;i++){ var row=$('#searchresults tr.template').clone(); row.removeClass('template'); row.addClass('result'); + if (index == 0){ + row.children('td.type').text(name); + } row.find('td.result a').attr('href',type[i].link); row.find('td.result div.name').text(type[i].name); row.find('td.result div.text').text(type[i].text); |