diff options
Diffstat (limited to 'src/dumbyUtils.mjs')
-rw-r--r-- | src/dumbyUtils.mjs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dumbyUtils.mjs b/src/dumbyUtils.mjs index c7b45f4..5de5b05 100644 --- a/src/dumbyUtils.mjs +++ b/src/dumbyUtils.mjs | |||
@@ -6,7 +6,7 @@ import { insideWindow, insideParent } from './utils' | |||
6 | * | 6 | * |
7 | * @param {Boolean} reverse -- focus previous map | 7 | * @param {Boolean} reverse -- focus previous map |
8 | */ | 8 | */ |
9 | export function focusNextMap(reverse = false) { | 9 | export function focusNextMap (reverse = false) { |
10 | const renderedList = this.utils.renderedMaps() | 10 | const renderedList = this.utils.renderedMaps() |
11 | const index = renderedList.findIndex(e => e.classList.contains('focus')) | 11 | const index = renderedList.findIndex(e => e.classList.contains('focus')) |
12 | const nextIndex = (index + (reverse ? -1 : 1)) % renderedList.length | 12 | const nextIndex = (index + (reverse ? -1 : 1)) % renderedList.length |
@@ -21,7 +21,7 @@ export function focusNextMap(reverse = false) { | |||
21 | * | 21 | * |
22 | * @param {Boolean} reverse -- focus previous block | 22 | * @param {Boolean} reverse -- focus previous block |
23 | */ | 23 | */ |
24 | export function focusNextBlock(reverse = false) { | 24 | export function focusNextBlock (reverse = false) { |
25 | const blocks = this.blocks.filter(b => | 25 | const blocks = this.blocks.filter(b => |
26 | b.checkVisibility({ | 26 | b.checkVisibility({ |
27 | contentVisibilityAuto: true, | 27 | contentVisibilityAuto: true, |
@@ -56,7 +56,7 @@ export const scrollToBlock = block => { | |||
56 | /** | 56 | /** |
57 | * focusDelay. Delay of throttle, value changes by cases | 57 | * focusDelay. Delay of throttle, value changes by cases |
58 | */ | 58 | */ |
59 | export function focusDelay() { | 59 | export function focusDelay () { |
60 | return window.window.getComputedStyle(this.showcase).display === 'none' ? 50 : 300 | 60 | return window.window.getComputedStyle(this.showcase).display === 'none' ? 50 : 300 |
61 | } | 61 | } |
62 | 62 | ||
@@ -65,7 +65,7 @@ export function focusDelay() { | |||
65 | * | 65 | * |
66 | * @param {Boolean} reverse -- Switch to previous one | 66 | * @param {Boolean} reverse -- Switch to previous one |
67 | */ | 67 | */ |
68 | export function switchToNextLayout(reverse = false) { | 68 | export function switchToNextLayout (reverse = false) { |
69 | const layouts = this.layouts | 69 | const layouts = this.layouts |
70 | const currentLayoutName = this.container.getAttribute('data-layout') | 70 | const currentLayoutName = this.container.getAttribute('data-layout') |
71 | const currentIndex = layouts.map(l => l.name).indexOf(currentLayoutName) | 71 | const currentIndex = layouts.map(l => l.name).indexOf(currentLayoutName) |
@@ -81,7 +81,7 @@ export function switchToNextLayout(reverse = false) { | |||
81 | /** | 81 | /** |
82 | * removeBlockFocus. | 82 | * removeBlockFocus. |
83 | */ | 83 | */ |
84 | export function removeBlockFocus() { | 84 | export function removeBlockFocus () { |
85 | this.blocks.forEach(b => b.classList.remove('focus')) | 85 | this.blocks.forEach(b => b.classList.remove('focus')) |
86 | } | 86 | } |
87 | 87 | ||