1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

Pass Book object to Search Example

This commit is contained in:
Fred Chasen 2013-12-20 15:08:55 -08:00
parent 7eb6622c8e
commit 2126099ccd
2 changed files with 13 additions and 8 deletions

View file

@ -18,7 +18,7 @@ EPUBJSR.search.request = function(q, callback) {
});
};
EPUBJSR.search.View = function() {
EPUBJSR.search.View = function(Book) {
var $searchBox = $("#searchBox"),
$searchResults = $("#searchResults"),
@ -75,7 +75,9 @@ EPUBJSR.search.View = function() {
$item.on("click", function(e) {
var $this = $(this),
cfi = $this.data("cfi");
e.preventDefault();
Book.gotoCfi(cfi);
Book.on("renderer:chapterDisplayed", function() {
@ -83,7 +85,7 @@ EPUBJSR.search.View = function() {
$(iframeDoc).find('body').highlight(q, { element: 'span' });
})
e.preventDefault();
});
$li.append($item);