$(document).on(this.fluidbook.input.clickEvent, '.icon-help', function (e) {
$this.show();
if ($this.fluidbook.nav.menuIsOpen) {
- $this.fluidbook.nav.menuAPI.close();
+ $this.fluidbook.nav.closeMenu();
}
e.preventDefault();
});
__openView: function (view, param1, param2, callback) {
+ var closeMenu = true;
try {
if (typeof param1 === 'string') {
param1 = decodeURIComponent(param1);
} else if (view === 'freeiframe') {
this.openFreeiframe(param1, cb);
} else if (view === 'search') {
+ closeMenu = false;
this.openSearch(param1, cb);
} else if (view === 'print') {
this.openPrint(cb);
this['open' + camelView](param1, param2, cb);
}
- this.fluidbook.nav.closeMenu();
+ if (closeMenu) {
+ this.fluidbook.nav.closeMenu();
+ }
}, openNotes: function (p1, p2, cb) {
this.fluidbook.notes.openMenu(cb);
}, openSearch: function (q, cb) {
// Close menu when a search result is clicked
$(document).on(this.fluidbook.input.clickEvent, '#menuSearchResults a', function (e) {
- $this.menuAPI.close();
+ $this.closeMenu();
});
// Recalculate available size for menu search results
return false;
}
- $this.menuAPI.close();
+ $this.closeMenu();
});
$('#menuList > ul, #chapterList').perfectScrollbar({
suppressScrollX: true, minScrollbarLength: 40, //maxScrollbarLength: 60
});
- }, closeMenu: function () {
+ },
+ closeMenu: function () {
this.menuAPI.close();
}, // getIcon: function (name) {
// var src = 'data/images/' + name + '.';
window.location = $($thislink).attr('href');
}, 500);
} else {
- $this.menuAPI.close();
+ $this.closeMenu();
window.location = $(this).attr('href');
}
return false;
// Full screen toggle
$(document).on(this.fluidbook.input.clickEvent, '.icon-fullscreen', function () {
- $this.menuAPI.close();
+ $this.closeMenu();
screenfull.toggle();
return false;
});
this.menuAPI.closeAllPanels(); // Make sure we're on the main panel with the search box
}
}
- this.menuAPI.open();
+
if (q !== undefined) {
$("#q").val(q);
this.fluidbook.search.submitForm();
} else {
+ this.menuAPI.open();
$('#q').focus(); // Put cursor in the search field
}
if ($this.fluidbook.search.isSearchActive()) {
$this.fluidbook.search.closeSearch();
if ($("#horizontalNav").is(':visible')) {
- $this.menuAPI.close();
+ $this.closeMenu();
}
} else {
// If we're closing the menu but the search was open and nothing
$this.fluidbook.search.closeSearch();
}
- $this.menuAPI.close();
+ $this.closeMenu();
}
});
if (gotoPageIfOneResult && spreadEnabled === 1) {
setTimeout(function () {
fluidbook.setCurrentPage($this.menuSearchResults.find('.doubleThumb[data-enabled="1"]').attr('page'));
- fluidbook.nav.menuAPI.close();
+ fluidbook.nav.closeMenu();
}, 100);
return;
}