})
// Search form handler
- $(document).on('submit', '#searchForm', function () {
+ $(document).on('submit', '#menuSearch #searchForm', function (e) {
$this.fluidbook.search.submitForm();
return false;
});
e.pop();
e.push($(this).attr('term'));
$("#q").val(e.join(' '));
- $("#searchForm").submit();
+ if($this.fluidbook.search.isSearchfloatActive) {
+ var pageNumber = parseInt($("#menuSearchResults a").find('.doubleThumb').attr('page'));
+ $this.fluidbook.search.openResultsNav(pageNumber);
+ } else {
+ $("#searchForm").submit();
+ }
return false;
})
this.resultsNav = $('#' + this.resultsNavID);
//=== Event handlers
- $(document).on(this.fluidbook.input.clickEvent, 'body.floatmode #menuSearchHints a', function () {
- // Find the page number of the result so we can see where it sits in the list of returned results
- var pageNumber = parseInt($("#menuSearchResults a").find('.doubleThumb').attr('page'));
- $this.openResultsNav(pageNumber);
- });
-
$(document).on(this.fluidbook.input.clickEvent, '#menuSearchResults a', function () {
// Find the page number of the result so we can see where it sits in the list of returned results
var pageNumber = parseInt($(this).find('.doubleThumb').attr('page'));
});
$(this.fluidbook).on('fluidbook.resize.orientation', function (event, details) {
- if (!$this.resultsNavActive()) {
+ if (!$this.resultsNavActive() || $this.isSearchfloatActive) {
return;
}
$this.updateResultsNav($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) {
setTimeout(function () {
- fluidbook.setCurrentPage($this.menuSearchResults.find('.doubleThumb[data-enabled="1"][data-pages*='+referencePage+']').attr('page'));
- var pageNumber = parseInt($("#menuSearchResults a").find('.doubleThumb[data-enabled="1"][data-pages*='+referencePage+']').attr('page'));
+ fluidbook.setCurrentPage($this.menuSearchResults.find('.doubleThumb[data-enabled="1"][data-pages*='+parseInt(referencePage)+']').attr('page'));
+ var pageNumber = parseInt($("#menuSearchResults a").find('.doubleThumb[data-enabled="1"][data-pages*='+parseInt(referencePage)+']').attr('page'));
+ console.log(pageNumber)
$this.openResultsNav(pageNumber);
fluidbook.nav.burger.close();
}, 100);