aboutsummaryrefslogtreecommitdiffstats
path: root/core/search
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-01-18 22:06:54 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-01-18 22:06:54 +0100
commitc1e839961eb99df24742a605a5dfc1b10ed14d00 (patch)
treeaf17abad4c3df3b3455fcd0370f86439beaa9db6 /core/search
parent10ab678aa5f82885cef54140d9b1bed8c990ca2e (diff)
downloadnextcloud-server-c1e839961eb99df24742a605a5dfc1b10ed14d00.tar.gz
nextcloud-server-c1e839961eb99df24742a605a5dfc1b10ed14d00.zip
Include static search template in JS
There is no need to fetch this from the server if it is static anyway. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core/search')
-rw-r--r--core/search/js/searchprovider.js24
-rw-r--r--core/search/templates/part.results.html13
2 files changed, 16 insertions, 21 deletions
diff --git a/core/search/js/searchprovider.js b/core/search/js/searchprovider.js
index 86a22f570f8..7b4970b37f6 100644
--- a/core/search/js/searchprovider.js
+++ b/core/search/js/searchprovider.js
@@ -416,14 +416,22 @@ $(document).ready(function() {
var $searchBox = $('#searchbox');
if ($searchResults.length > 0 && $searchBox.length > 0) {
$searchResults.addClass('hidden');
- $searchResults.load(
- OC.getRootPath() + '/core/search/templates/part.results.html',
- function() {
- OC.Search = new OCA.Search.Core(
- $searchBox,
- $searchResults
- );
- }
+ $searchResults.html('<table>\n' +
+ '\t<tbody>\n' +
+ '\t\t<tr class="template">\n' +
+ '\t\t\t<td class="icon"></td>\n' +
+ '\t\t\t<td class="info">\n' +
+ '\t\t\t\t<a class="link">\n' +
+ '\t\t\t\t\t<div class="name"></div>\n' +
+ '\t\t\t\t</a>\n' +
+ '\t\t\t</td>\n' +
+ '\t\t</tr>\n' +
+ '\t</tbody>\n' +
+ '</table>\n' +
+ '<div id="status"><span></span></div>');
+ OC.Search = new OCA.Search.Core(
+ $searchBox,
+ $searchResults
);
} else {
// check again later
diff --git a/core/search/templates/part.results.html b/core/search/templates/part.results.html
deleted file mode 100644
index 6fad9f2cdd8..00000000000
--- a/core/search/templates/part.results.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<table>
- <tbody>
- <tr class="template">
- <td class="icon"></td>
- <td class="info">
- <a class="link">
- <div class="name"></div>
- </a>
- </td>
- </tr>
- </tbody>
-</table>
-<div id="status"><span></span></div> \ No newline at end of file