summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-08-03 00:30:21 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-08-03 00:30:21 +0200
commita2062036d325c45a7bc0e50ddb39fe5b238cde41 (patch)
treecfac15d4d91a8c0343f4f576bc69210122c239b8 /apps
parentad513284081da89c1d25936b3b2aeca16a8732ab (diff)
downloadnextcloud-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.js12
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);
+ });
+ }
});