diff options
author | Raimund Schlüßler <raimund.schluessler@googlemail.com> | 2015-02-08 22:42:30 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-02-27 17:14:03 +0100 |
commit | 83dd98426c92787500453c296788ff2a73ac0f4a (patch) | |
tree | 94dece6c26f44da1cfad33c6074591690c3194ea /core | |
parent | 0ec73a58e92b34aec7af28208156205945d608d9 (diff) | |
download | nextcloud-server-83dd98426c92787500453c296788ff2a73ac0f4a.tar.gz nextcloud-server-83dd98426c92787500453c296788ff2a73ac0f4a.zip |
Append search results to custom container
* fixes #13968
* fix variable already defined
Diffstat (limited to 'core')
-rw-r--r-- | core/search/js/search.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/core/search/js/search.js b/core/search/js/search.js index 21e77ec21d9..c7feeacf42e 100644 --- a/core/search/js/search.js +++ b/core/search/js/search.js @@ -360,10 +360,17 @@ })(); $(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 { + $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')); }); |