this.indexLoaded = false;
this.termsToHighlight = [];
this.highlights = [];
+ this.highlightEnabled = fluidbook.datas.highlightResults;
this.init();
}
var $this = this;
loadJSLibrary('data/search.index.js', function () {
loadJSLibrary('data/search.texts.js', function () {
- loadJSLibrary('data/search.highlight.js', function () {
+ if ($this.highlightEnabled) {
+ loadJSLibrary('data/search.highlight.js', function () {
+ $this.indexLoaded = true;
+ callback();
+ });
+ } else {
$this.indexLoaded = true;
callback();
- });
+ }
});
});
},
return source;
},
setHighlightTerms: function (terms) {
+ if(!this.highlightEnabled){
+ return;
+ }
this.termsToHighlight = terms;
this.highlights = [];
if (terms.length == 0) {
$("#searchHighlights").html('');
},
highlightSearchTerms: function (pageNr) {
+ if(!this.highlightEnabled){
+ return;
+ }
this.clearHighlights();
if (this.termsToHighlight.length == 0) {
return;