]> source.dussan.org Git - nextcloud-server.git/commitdiff
Append search results to custom container
authorRaimund Schlüßler <raimund.schluessler@googlemail.com>
Sun, 8 Feb 2015 21:42:30 +0000 (22:42 +0100)
committerRaimund Schlüßler <raimund.schluessler@googlemail.com>
Sun, 8 Feb 2015 21:42:30 +0000 (22:42 +0100)
fixes #13968

core/search/js/search.js

index c6542ffc138090726a033e3f6ce91a1e8a110ee2..599a7c7d5c205dea22f33caa55654eb61068a470 100644 (file)
 })();
 
 $(document).ready(function() {
-       var $searchResults = $('<div id="searchresults" class="hidden"/>');
-       $('#app-content')
-               .append($searchResults)
-               .find('.viewcontainer').css('min-height', 'initial');
+       var $searchResults = $('#searchresults');
+       if ($searchResults.length) {
+               $searchResults.addClass('hidden');
+               $('#app-content')
+                       .find('.viewcontainer').css('min-height', 'initial');
+       } else {
+               var $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'));
        });