diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-12-15 16:14:40 +0100 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-12-15 16:14:40 +0100 |
commit | 6602d3ac777f0338e1fcfbd9c4a67c1fdf792905 (patch) | |
tree | 2951edf03a2b0e8bd11cb3cd8105f4d8f4fca76d /core/js | |
parent | d367d1b06a1b9dece52c57d973b4c2ab6aa63772 (diff) | |
parent | 1d490b559ce279f5c9f44b727fe9d71d3718a24b (diff) | |
download | nextcloud-server-6602d3ac777f0338e1fcfbd9c4a67c1fdf792905.tar.gz nextcloud-server-6602d3ac777f0338e1fcfbd9c4a67c1fdf792905.zip |
Merge pull request #12555 from owncloud/app_specific_search
introduce inApps[] filter for search via ajax query
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/js.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/js/js.js b/core/js/js.js index cc3a548de28..a4f66ac7d90 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -292,7 +292,14 @@ var OC={ search: _.debounce(function(query){ if(query){ OC.addStyle('search','results'); - $.getJSON(OC.filePath('search','ajax','search.php')+'?query='+encodeURIComponent(query), function(results){ + var classList = document.getElementById('content').className.split(/\s+/); + var inApps = []; + for (var i = 0; i < classList.length; i++) { + if (classList[i].indexOf('app-') === 0) { + var inApps = [classList[i].substr(4)]; + } + } + $.getJSON(OC.generateUrl('search/ajax/search.php'), {inApps:inApps, query:query}, function(results){ OC.search.lastResults=results; OC.search.showResults(results); }); |