From 1d490b559ce279f5c9f44b727fe9d71d3718a24b Mon Sep 17 00:00:00 2001 From: Jörn Friedrich Dreyer Date: Tue, 2 Dec 2014 17:31:04 +0100 Subject: introduce inApps[] filter for search via ajax query, make file results show up in files app only use more flexible return type check array with !empty instead of count --- core/js/js.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'core/js/js.js') diff --git a/core/js/js.js b/core/js/js.js index eb2f10b51f0..e62a5474426 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); }); -- cgit v1.2.3