diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-09-17 17:27:47 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-09-17 18:40:52 +0200 |
commit | 8bdafaf4e0b14d1437612483a6187c21533846db (patch) | |
tree | 2c3e71a989d6b23ba4b36a3bc814b49c902c011e /search | |
parent | 00772a84701cbfbd794db1d9c40f8cd98a40b9b2 (diff) | |
download | nextcloud-server-8bdafaf4e0b14d1437612483a6187c21533846db.tar.gz nextcloud-server-8bdafaf4e0b14d1437612483a6187c21533846db.zip |
make 'open in folder' action default for files
Diffstat (limited to 'search')
-rw-r--r-- | search/js/result.js | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/search/js/result.js b/search/js/result.js index 78d9149f220..bfd81f4851e 100644 --- a/search/js/result.js +++ b/search/js/result.js @@ -50,43 +50,50 @@ OC.search.showResults=function(results){ $('#searchresults').show(); $('#searchresults tr.result').remove(); var index=0; - for(var name in types){ - var type=types[name]; + for(var typeid in types){ + var type=types[typeid]; if(type.length>0){ for(var i=0;i<type.length;i++){ var row=$('#searchresults tr.template').clone(); row.removeClass('template'); row.addClass('result'); + row.data('type', typeid); + row.data('name', type[i].name); + row.data('text', type[i].text); + row.data('container', type[i].container); if (i === 0){ - row.children('td.type').text(name); + row.children('td.type').text(typeid); } - 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); if (type[i].container) { - var td = row.find('td.container'); - td.append('<a><img></img></a>'); - td.find('img').attr('src',OC.imagePath('core','places/folder')); var containerName = OC.basename(type[i].container); if (containerName === '') { containerName = '/'; } - var containerLink = OC.linkTo('files','index.php') - +'?dir='+encodeURIComponent(type[i].container) - +'&scrollto='+encodeURIComponent(type[i].name); - row.find('td.container a') - .attr('href',containerLink) - .attr('title',t('core','Show in {folder}',{folder: containerName})); + var containerLink = OC.linkTo('files', 'index.php') + +'?dir='+encodeURIComponent(type[i].container) + +'&scrollto='+encodeURIComponent(type[i].name); + row.find('td.result a') + .attr('href', containerLink) + .attr('title', t('core', 'Show in {folder}', {folder: containerName})); + } else { + row.find('td.result a').attr('href', type[i].link); } 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[i]); + if(OC.search.customResults[typeid]){//give plugins the ability to customize the entries in here + OC.search.customResults[typeid](row,type[i]); } $('#searchresults tbody').append(row); } } } + $('#searchresults').on('click', 'result', function () { + if ($(this).data('type') === 'Files') { + + } + }); } }; OC.search.showResults.loaded=false; |