diff options
-rw-r--r-- | apps/files/templates/index.php | 1 | ||||
-rw-r--r-- | core/search/js/search.js | 13 |
2 files changed, 6 insertions, 8 deletions
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index a068f306ac4..e825c300d31 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -6,6 +6,7 @@ <?php print_unescaped($content['content']) ?> </div> <?php } ?> + <div id="searchresults" class="hidden"></div> </div><!-- closing app-content --> <!-- config hints for javascript --> diff --git a/core/search/js/search.js b/core/search/js/search.js index 4d0cf69eeba..22769ee2e48 100644 --- a/core/search/js/search.js +++ b/core/search/js/search.js @@ -379,19 +379,16 @@ $(document).ready(function() { var $searchResults = $('#searchresults'); - if ($searchResults.length) { + if ($searchResults.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($('#searchbox'), $('#searchresults')); + }); } else { - $searchResults = $('<div id="searchresults" class="hidden"/>'); - $('#app-content') - .append($searchResults) - .find('.viewcontainer').css('min-height', 'initial'); - } - $searchResults.load(OC.webroot + '/core/search/templates/part.results.html', function () { OC.Search = new OCA.Search($('#searchbox'), $('#searchresults')); - }); + } }); /** |