summaryrefslogtreecommitdiffstats
path: root/core/search/js/searchprovider.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/search/js/searchprovider.js')
-rw-r--r--core/search/js/searchprovider.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/core/search/js/searchprovider.js b/core/search/js/searchprovider.js
index 4a484050385..f5a499fab60 100644
--- a/core/search/js/searchprovider.js
+++ b/core/search/js/searchprovider.js
@@ -413,26 +413,27 @@
$(document).ready(function() {
var $searchResults = $('#searchresults');
- if ($searchResults.length > 0) {
+ var $searchBox = $('#searchbox');
+ if ($searchResults.length > 0 && $searchBox.length > 0) {
$searchResults.addClass('hidden');
- $('#app-content')
- .find('.viewcontainer')
- .css('min-height', 'initial');
$searchResults.load(
OC.webroot + '/core/search/templates/part.results.html',
function() {
OC.Search = new OCA.Search.Core(
- $('#searchbox'),
- $('#searchresults')
+ $searchBox,
+ $searchResults
);
}
);
} else {
+ // check again later
_.defer(function() {
- OC.Search = new OCA.Search.Core(
- $('#searchbox'),
- $('#searchresults')
- );
+ if ($searchResults.length > 0 && $searchBox.length > 0) {
+ OC.Search = new OCA.Search.Core(
+ $searchBox,
+ $searchResults
+ );
+ }
});
}
});