From: Vincent Vanwaelscappel Date: Fri, 4 Jul 2025 11:07:54 +0000 (+0200) Subject: wait #7547 @0.75 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=09899de9633a7f3c773711bf1cf5d7905c1f44eb;p=fluidbook-html5.git wait #7547 @0.75 --- diff --git a/js/libs/fluidbook/fluidbook.keyboard.js b/js/libs/fluidbook/fluidbook.keyboard.js index 2fb02768..dd0aae0e 100644 --- a/js/libs/fluidbook/fluidbook.keyboard.js +++ b/js/libs/fluidbook/fluidbook.keyboard.js @@ -26,12 +26,9 @@ FluidbookKeyboard.prototype = { $this.tabNavigation('.mview', dir); e.preventDefault(); } else { - if ($this.tabNavigationSections([ - '#next', '#previous', - '.audio-description-wrapper.left', '.audio-description-wrapper.right', //. + if ($this.tabNavigationSections(['#next', '#previous', '.audio-description-wrapper.left', '.audio-description-wrapper.right', //. '#links .leftContainer .linksHolder', '#links .rightContainer .linksHolder', //. - '#links .leftContainer .bookmark', '#links .rightContainer .bookmark', - '#last', '#first', //. + '#links .leftContainer .bookmark', '#links .rightContainer .bookmark', '#last', '#first', //. '#horizontalNav', '#menuOpener', //. '#logo', //. '#credits',], dir)) { @@ -141,12 +138,15 @@ FluidbookKeyboard.prototype = { elements = $(selector).find(focusableElementsString); } var list = []; + console.log(selector,elements); $(elements).each(function () { if (parseInt($(this).attr('tabindex')) < 0) { return; } if ($(this).parents('[tabindex="-1"],.ignore-tab-children').length === 0 && $(this).is(':visible')) { list.push(this); + } else { + console.log('skip', this); } }); if (list.length === 0) { @@ -175,6 +175,10 @@ FluidbookKeyboard.prototype = { } var items = $(list); var nb = items.length; + if (!nb) { + console.log('no item here', list); + return false; + } var next; if ($(items).has(document.activeElement)) { var index = $(items).index(document.activeElement); @@ -196,6 +200,7 @@ FluidbookKeyboard.prototype = { next = nb - 1; } } + var ne = $(items).eq(next); console.log(items, ne); $.each(actions, function (k, action) { @@ -209,21 +214,6 @@ FluidbookKeyboard.prototype = { return true; }, - tabNavigation: function (selector, dir) { - var focusableElementsString = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"]:not(.ps__thumb-x):not(.ps__thumb-y), [contenteditable], button'; - var elements = $(selector).find(focusableElementsString); - var list = []; - $(elements).each(function () { - if ($(this).attr('tabindex') == '-1') { - return; - } - if ($(this).parents('.ignore-tab-children').length === 0 && $(this).is(':visible')) { - list.push(this); - } - }); - return this._navigate(list, dir); - }, - initBookmarksShortcuts: function () { var $this = this; this.keyShortcut('ctrl+alt+d', function () {