this.initResultsNav();
- if($('body').hasClass('floatmode')) {
+ if ($('body').hasClass('floatmode')) {
this.isSearchfloatActive = true;
}
});
$(document).on(this.fluidbook.input.clickEvent, '.searchResultsNavClose', function () {
- if($this.fluidbook.search.isSearchfloatActive) {
+ if ($this.fluidbook.search.isSearchfloatActive) {
$this.closeResultsNavInFloatMode();
- }else {
+ } else {
$this.closeResultsNav();
}
});
updateResultsNav: function (resultPage) {
// To avoid double calls causing problems
- if(!this.isSearchfloatActive) {
+ if (!this.isSearchfloatActive) {
this.callNumber = 0;
}
// If we are in landscape view, there are 2 pages visible,
// so we only want even pages in our results. The resultPages
// includes all pages by default so we need to convert odd pages
// to even and remove duplicates created.
- if(this.callNumber < 1) {
+ if (this.callNumber < 1) {
if (this.fluidbook.resize.orientation === "landscape") {
const noOddPages = this.resultPages.map(function (page) {
$('body').removeClass(this.resultsActiveClass);
},
- closeResultsNavInFloatMode: function() {
+ closeResultsNavInFloatMode: function () {
this.hideableElements.removeClass('hidden');
this.resultsNav.addClass('hideUp').addClass('hidden');
setTimeout(() => {
if (k.indexOf(q) !== 0) {
continue;
}
- res.push([k, v.t]);
+ for (var w in v.w){
+ break;
+ }
+ res.push([w, v.t]);
}
for (var p in this.plugins) {
this.highlightSearchTerms(this.fluidbook.currentPage);
// Redirect to the only result page if the flag is enabled
- if(this.fluidbook.search.isSearchfloatActive && $this.menuSearchResults.find('.doubleThumb[data-enabled="1"]').length > 0) {
+ if (this.fluidbook.search.isSearchfloatActive && $this.menuSearchResults.find('.doubleThumb[data-enabled="1"]').length > 0) {
this.callNumber = 0;
setTimeout(function () {
let page = referencePage;
- let pageNumber = parseInt($("#menuSearchResults a").find('.doubleThumb[data-enabled="1"][data-pages*='+parseInt(referencePage)+']').attr('page'));
- if($this.fluidbook.resize.orientation === "landscape") {
+ let pageNumber = parseInt($("#menuSearchResults a").find('.doubleThumb[data-enabled="1"][data-pages*=' + parseInt(referencePage) + ']').attr('page'));
+ if ($this.fluidbook.resize.orientation === "landscape") {
page = pageNumber;
}
fluidbook.setCurrentPage(page);
}
}
- if(!this.fluidbook.search.isSearchfloatActive) {
- this.menuSearchResults.fadeIn(300).scrollTop(0);
+ if (!this.fluidbook.search.isSearchfloatActive) {
+ this.menuSearchResults.fadeIn(300).scrollTop(0);
}
// On some phones, the height of the search results is miscalculated due to the