diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-08-03 00:30:21 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-08-03 00:30:21 +0200 |
commit | a2062036d325c45a7bc0e50ddb39fe5b238cde41 (patch) | |
tree | cfac15d4d91a8c0343f4f576bc69210122c239b8 /apps | |
parent | ad513284081da89c1d25936b3b2aeca16a8732ab (diff) | |
download | nextcloud-server-a2062036d325c45a7bc0e50ddb39fe5b238cde41.tar.gz nextcloud-server-a2062036d325c45a7bc0e50ddb39fe5b238cde41.zip |
selecting a text file from the search results now activates the text viewer
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_textviewer/js/textviewer.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files_textviewer/js/textviewer.js b/apps/files_textviewer/js/textviewer.js index d650c44d5ab..b1a564df9bb 100644 --- a/apps/files_textviewer/js/textviewer.js +++ b/apps/files_textviewer/js/textviewer.js @@ -116,4 +116,16 @@ $(document).ready(function() { }); FileActions.setDefault('application/xml','View'); } + OC.search.customResults.Text=function(row,item){ + var text=item.link.substr(item.link.indexOf('file=')+5); + var a=row.find('a'); + a.data('file',text); + a.attr('href','#'); + a.click(function(){ + var file=$(this).data('file'); + var text=file.split('/').pop(); + var dir=file.substr(0,file.length-file.length-1); + TextViewer.showText(dir,text); + }); + } }); |