소스 검색

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>
Roeland Jago Douma 5 년 전
부모
커밋
c1e839961e
2개의 변경된 파일16개의 추가작업 그리고 21개의 파일을 삭제
  1. 16 8
      core/search/js/searchprovider.js
  2. 0 13
      core/search/templates/part.results.html

+ 16 - 8
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

+ 0 - 13
core/search/templates/part.results.html

@@ -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>