var $this = this;
var camelView = view.charAt(0).toUpperCase() + view.substr(1);
var cb = function () {
- $this.openingView(callback);
+ $this.openingView(callback, view);
};
if (view == 'index') {
this.openIndex(this.fluidbook.l10n.__('overview'), undefined, true, cb);
openSearch: function (q, cb) {
this.fluidbook.nav.openSearch(q, cb);
},
- openingView: function (callback) {
+ openingView: function (callback, view) {
var $this = this;
this.fluidbook.resize.resizeView();
this.fluidbook.tooltip.hideTooltip();
var to = {y: "0px", opacity: 1};
if (mview.hasClass('fs')) {
from.y = "0px";
- } else {
+ } else if (view !== 'search') {
this.showOverlay();
}
for (var p in this.plugins) {
var plugin = this.plugins[p];
var h = plugin.getHints(q);
- console.log(h);
res = res.concat(h);
}
},
clearHighlights: function () {
$("#searchHighlights").html('');
+ for (var p in this.plugins) {
+ var plugin = this.plugins[p];
+ plugin.clearHighlights();
+ }
},
highlightSearchTerms: function (pageNr) {
if (!this.highlightEnabled) {
return;
}
+ for (var p in this.plugins) {
+ var plugin = this.plugins[p];
+ plugin.highlight(pageNr, this.termsToHighlight);
+ }
+
// Test if we highlight results
if (!this.fluidbook.datas.highlightAllOccurences) {
var evenPageNumber = pageNr;
this.menuSearchHints.fadeIn(300);
- this.initSearchResults();
-
// if (this.menuSearchHints.hasClass('mm-hidden')) {
// this.nav.menuAPI.openPanel(this.menuSearchHints, false);
// }
return !res;
},
+
+ highlight: function (pageNr, terms) {
+ console.log(terms);
+ this.clearHighlights();
+ $.each(terms, function (k, v) {
+ console.log(v, $('[data-wescosales-ref="' + v + '"]'));
+ $('[data-wescosales-ref="' + v + '"]').addClass('highlight');
+ });
+ },
+ clearHighlights: function () {
+ $('[data-wescosales-ref].highlight').removeClass('highlight');
+ },
};
\ No newline at end of file