Browse Source

add locations to search results

Andrew Dolgov 8 months ago
parent
commit
aa1aa65ed8
3 changed files with 5 additions and 3 deletions
  1. 3 1
      css/read.css
  2. 1 1
      js/read.js
  3. 1 1
      read.html

+ 3 - 1
css/read.css

@@ -117,8 +117,10 @@
 	overflow : auto;
 }
 
-.toc_list b.pull-right {
+.toc_list b.pull-right,
+.search_results b.pull-right {
 	margin-right : 16px;
+	margin-left : 16px;
 }
 
 .toc_sublist {

+ 1 - 1
js/read.js

@@ -284,7 +284,7 @@ function search() {
 			$.each(results, function (i, row) {
 				var a = $("<a>")
 					.attr('href', '#')
-					.html(row.excerpt)
+					.html("<b class='pull-right'>" + window.book.locations.locationFromCfi(row.cfi) + "</b>" + row.excerpt)
 					.attr('data-cfi', row.cfi)
 					.attr('data-id', row.id)
 					.click(function() {

+ 1 - 1
read.html

@@ -170,7 +170,7 @@
 					</div>
   				</div>
 
-				<ol class="search_results"> </ol>
+				<ul class="search_results list-unstyled"> </ul>
 
 			</form>