this.fluidbook = nav.fluidbook;
this.closeTimeout;
this.isOpened = false;
- this.floatmode = this.fluidbook.floatmode;
}
FluidbookBurger.prototype = {
// Add holder list element for menu items
$("#menu").append('<div id="menuList"' + v2 + '><ul></ul></div>');
- if(this.floatmode) {
+ if(this.fluidbook.search.isSearchfloatActive) {
$('body').append(this.initSearch());
} else {
this.searchHTML = this.initSearch()
if (!this.isOpened) {
$('body').addClass('menu-open');
$("#menuOverlay").show();
- if(!this.floatmode) {
+ if(!this.fluidbook.search.isSearchfloatActive) {
$("#menu").show()
}
setTimeout(function () {
} else {
this.open(false);
- if(this.floatmode && !floatSearchVisible) {
+ if(this.fluidbook.search.isSearchfloatActive && !floatSearchVisible) {
$("#menuSearch").hide().removeClass('hidden')
setTimeout(function(){
$("#menuSearch").show()
let $this = this;
let res = this.getSearchHtml();
- if(this.floatmode) {
+ if(this.fluidbook.search.isSearchfloatActive) {
res = this.getFloatSearchHTML()
}
search.append(res);
// Close floatSearch
const menuSearchClose = $("#menuSearchClose")
- if(!this.floatmode) {
+ if(!this.fluidbook.search.isSearchfloatActive) {
menuSearchClose.hide()
}
this.help = new FluidbookHelp(this);
this.articles = new FluidbookArticles(this);
+
try {
$('head').append('<style>#shadow > .shadow{' + new Solver(new Color(this.settings.bookShadeColor[0], this.settings.bookShadeColor[1], this.settings.bookShadeColor[2])).solve().filter + '}</style>');
} catch (e) {
this.datas = this.settings;
$('html').addClass('linksanimation-' + this.settings.linksAnimation);
$('html').addClass('linksanimationlayer-' + this.settings.linksAnimationLayer);
+
+ // Add class if search is float
+ if(this.settings.search_field === "float") {
+ $('body').addClass('floatmode');
+ }
},
setMaxPage: function (p, allowbackwards) {
// MMenu specific elements
if (navType === 'menu') {
this.burger.initNav();
- this.burger.initSearch();
if (this.fluidbook.settings.navOrderH.length > 0) {
navOrder = this.fluidbook.settings.navOrderH;
}
// Search icon in horizontal menu
$(document).on(this.fluidbook.input.clickEvent, '#horizontalNav_searchIcon', function (event) {
- event.preventDefault()
+ event.preventDefault();
$this.burger.openSearch();
});
--- /dev/null
+function FluidbookSearchFloat(fluidbook) {
+ this.fluidbook = fluidbook;
+ this.init();
+}
+
+FluidbookSearchFloat.prototype = {
+ init: function() {
+ console.log('ok search float')
+ }
+}
\ No newline at end of file
function FluidbookSearch(fluidbook) {
this.fluidbook = fluidbook;
- //this.searchfloat = new FluidbookSearchFloat(fluidbook);
+ this.isSearchfloatActive = null;
this.indexLoaded = false;
this.indexLoading = false;
this.termsToHighlight = [];
});
this.initResultsNav();
+
+ if($('body').hasClass('floatmode')) {
+ this.isSearchfloatActive = true;
+ }
+
+ this.searchfloat = new FluidbookSearchFloat(this.fluidbook);
},
debugSearch: function (keyword) {
});
$(document).on(this.fluidbook.input.clickEvent, '.searchResultsNavClose', function () {
- if($this.fluidbook.floatmode) {
+ if($this.fluidbook.search.isSearchfloatActive) {
$this.closeResultsNavInFloatMode();
}else {
$this.closeResultsNav();
var $this = this;
this.find(q, function (results) {
- $this.openResults(results, this.fluidbook.floatmode);
+ $this.openResults(results);
});
},
this.highlightSearchTerms(this.fluidbook.currentPage);
// Redirect to the only result page if the flag is enabled
- if(this.fluidbook.nav.burger.floatmode && gotoPageIfOneResult) {
+ if(this.fluidbook.search.isSearchfloatActive && $this.menuSearchResults.find('.doubleThumb[data-enabled="1"]').length > 0) {
setTimeout(function () {
fluidbook.setCurrentPage($this.menuSearchResults.find('.doubleThumb[data-enabled="1"]').attr('page'));
var pageNumber = parseInt($("#menuSearchResults a").find('.doubleThumb').attr('page'));
}
}
+ 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
// keyboard being open and reducing the available window height. We need to wait until