]> _ Git - fluidbook-html5.git/commitdiff
wip #7547 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 25 Jun 2025 13:58:34 +0000 (15:58 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 25 Jun 2025 13:58:34 +0000 (15:58 +0200)
js/libs/fluidbook/fluidbook.keyboard.js
js/libs/fluidbook/fluidbook.tooltip.js

index 8d780d76abffb6ce7a86b12789eb3a22a6dbd09c..bf37f6fe9c0b197d9a4d9438a20cc79ad7f91223 100644 (file)
@@ -85,7 +85,7 @@ FluidbookKeyboard.prototype = {
             currentSection = 0;
         }
         let loop = 0;
-        while (!this.tabNavigation(selectors[currentSection], dir, false)) {
+        while (!this.tabNavigation(selectors[currentSection], dir, false, loop > 0)) {
             currentSection += dir;
             if (currentSection >= selectors.length || currentSection < 0) {
                 return false;
@@ -98,7 +98,10 @@ FluidbookKeyboard.prototype = {
         return true;
     },
 
-    tabNavigation: function (selector, dir, loop) {
+    tabNavigation: function (selector, dir, loop, switchList) {
+        if (switchList === undefined) {
+            switchList = false;
+        }
         if (loop === undefined) {
             loop = true;
         }
@@ -122,14 +125,17 @@ FluidbookKeyboard.prototype = {
             console.log(selector, 'nothing here');
             return false;
         }
-        let res = this._navigate(list, dir, ['focus'], loop);
+        let res = this._navigate(list, dir, ['focus'], loop, switchList);
         if (!res) {
             console.log(selector, 'end of list');
         }
         return res;
     },
 
-    _navigate: function (list, dir, actions, loop) {
+    _navigate: function (list, dir, actions, loop, switchList) {
+        if (switchList === undefined) {
+            switchList = false;
+        }
         if (loop === undefined) {
             loop = true;
         }
@@ -148,6 +154,9 @@ FluidbookKeyboard.prototype = {
                 next = (nb + index + dir) % nb;
             } else {
                 next = index + dir;
+                if (switchList && next === -2) {
+                    next = nb - 1;
+                }
                 if (next >= nb || next < 0) {
                     return false;
                 }
index 25e16e480bd08b5d2937c06b814e2a04ed0a8752..0976b3790551251554260faf1a5af7a7126b63f9 100644 (file)
@@ -177,7 +177,6 @@ FluidbookTooltip.prototype = {
     },
 
     displayTooltip: function (text, style, css) {
-        console.log('displayTooltip', text, style, css);
         if (text === '-') {
             return this.hideTooltip('before displayTooltip');
         }
@@ -231,7 +230,7 @@ FluidbookTooltip.prototype = {
     },
 
     hideTooltip: function (where) {
-        console.log('hide tooltip', where);
+        //console.log('hide tooltip', where);
         $("#tooltip").hide().text('');
     },