});
},
- open: function () {
+ open: function (focusClose) {
+ if (focusClose === undefined) {
+ focusClose = true;
+ }
let $this = this;
- this.isOpened = true;
- $('body').addClass('menu-open');
clearTimeout(this.closeTimeout);
- $("#menu,#menuOverlay").show();
- setTimeout(function () {
- $("#menu").addClass('open');
+ if (!this.isOpened) {
+ $('body').addClass('menu-open');
+ $("#menu,#menuOverlay").show();
setTimeout(function () {
- if ($this.fluidbook.input.isUsingKeyboard()) {
- console.log('focus close')
- $("#menuClose").get(0).focus();
+ $("#menu").addClass('open');
+ if (focusClose) {
+ setTimeout(function () {
+ if ($this.fluidbook.input.isUsingKeyboard()) {
+ $("#menuClose").get(0).focus();
+ }
+ }, 500);
}
- }, 500);
- }, 10);
-
- $("#main").attr('aria-hidden', 'true');
- $("#view").attr('aria-hidden', 'true');
- $("#menu").attr('aria-hidden', 'false');
- $("#menuOpener").attr('aria-expanded', 'true');
-
+ }, 10);
+ $("#main").attr('aria-hidden', 'true');
+ $("#view").attr('aria-hidden', 'true');
+ $("#menu").attr('aria-hidden', 'false');
+ $("#menuOpener").attr('aria-expanded', 'true');
+ } else {
+ console.log('already opened');
+ }
+ this.isOpened = true;
},
closeAll: function () {
},
hideMenuItems: function () {
- gsap.to($('#menuList > li, #shareLinks,footer#mobile-credits'), {duration: 0.1, autoAlpha: 0});
+ gsap.to($('#menuList > li, #shareLinks,footer#mobile-credits'), {duration: 0.1, opacity: 0, display: 'none'});
},
showMenuItems: function () {
- gsap.to($('#menuList > li, #shareLinks,footer#mobile-credits'), {duration: 0.3, autoAlpha: 1});
+ gsap.to($('#menuList > li, #shareLinks,footer#mobile-credits'), {duration: 0.3, opacity: 1, display: 'block'});
},
openSearch: function (q, cb) {
this.fluidbook.search.submitForm();
}
} else {
- this.open();
+ this.open(false);
$('#q').focus(); // Put cursor in the search field
}
case 38: // Up arrow
case 39: // Right arrow
case 40: // Down arrow
+ case 9: // Tab
return; // Ignore these keys
default:
- searchHints();
+ $this.fluidbook.search.searchHints();
}
});
});
},
+ searchHints: function () {
+ this.hideSearchResults();
+ if ($("#q").val().length >= 1) {
+ this.initSearchHints();
+ this.getSearchHints($("#q").val());
+ } else {
+ try {
+ if ($("#q").val().length == 0) {
+ this.hideSearchHints();
+ this.fluidbook.nav.burger.showMenuItems(); // Show main menu items that were hidden previously
+ }
+ } catch (err) {
+ }
+ }
+ },
+
displaySearchHints: function (hints) {
if (!this.hintsEnabled) {
return;
-window.stats=new FluidbookStats();
+window.stats = new FluidbookStats();
var DEVICE_READY_BEFORE_JQUERY = false;
var JQUERY_READY = false;
}
try {
window.fluidbook.loadPlugins();
- }catch (e){
+ } catch (e) {
}
$(document).trigger('fluidbook.init');
window.fluidbook.ready();
}
- if(this.fluidbook.secureOKDone) {
+ if (this.fluidbook.secureOKDone) {
initEvents();
- }else{
- this.fluidbook.initEventsWhenSecureOK=true;
+ } else {
+ this.fluidbook.initEventsWhenSecureOK = true;
}
}
}
-
$(window).on('hashchange', function () {
if (maskHashChange) {
return;
fluidbook.setBackground(page, resolution);
}
-function searchHints() {
- if ($("#q").val().length >= 1) {
- fluidbook.search.initSearchHints();
- fluidbook.search.getSearchHints($("#q").val());
- } else {
- try {
- if ($("#q").val().length == 0) {
- fluidbook.search.hideSearchHints();
- fluidbook.search.hideSearchResults();
- fluidbook.nav.burger.showMenuItems(); // Show main menu items that were hidden previously
- }
- } catch (err) {
- }
- }
-}
+
function lazy() {