for full-text search, use the page number in the par object, not the
authorrajbot <raj@archive.org>
Wed, 20 Oct 2010 05:28:05 +0000 (05:28 +0000)
committerrajbot <raj@archive.org>
Wed, 20 Oct 2010 05:28:05 +0000 (05:28 +0000)
box object, since it is sometimes missing.

BookReader/BookReader.js

index 5f9dcfc..2069e7f 100644 (file)
@@ -2870,9 +2870,10 @@ BookReader.prototype.updateSearchHilites2UP = function() {
     var i, j;
     for (i=0; i<results.matches.length; i++) {
         //console.log(results.matches[i].par[0]);
+        //TODO: loop over all par objects
+        var pageIndex = this.leafNumToIndex(results.matches[i].par[0].page);        
         for (j=0; j<results.matches[i].par[0].boxes.length; j++) {
             var box = results.matches[i].par[0].boxes[j];
-            var pageIndex = this.leafNumToIndex(box.page);
             if (jQuery.inArray(pageIndex, this.displayedIndices) >= 0) {
                 if (null == box.div) {
                     //create a div for the search highlight, and stash it in the box object