aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dumbymap.mjs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dumbymap.mjs b/src/dumbymap.mjs
index 1e8c38d..59c656c 100644
--- a/src/dumbymap.mjs
+++ b/src/dumbymap.mjs
@@ -179,23 +179,23 @@ function switchToNextLayout(reverse = false) {
179} 179}
180 180
181function focusNextBlock(reverse = false) { 181function focusNextBlock(reverse = false) {
182 const blocks = this.blocks.filter(b=>b.checkVisibility({ 182 const blocks = this.blocks.filter(b => b.checkVisibility({
183 contentVisibilityAuto: true, 183 contentVisibilityAuto: true,
184 opacityProperty: true, 184 opacityProperty: true,
185 visibilityProperty: true, 185 visibilityProperty: true,
186 })) 186 }))
187 const currentBlock = blocks.find(b=>b.classList.contains('focus')) 187 const currentBlock = blocks.find(b => b.classList.contains('focus'))
188 const currentIndex = blocks.indexOf(currentBlock) 188 const currentIndex = blocks.indexOf(currentBlock)
189 const padding = reverse ? -1 : 1 189 const padding = reverse ? -1 : 1
190 const nextIndex = currentIndex === -1 ? 0 : (currentIndex + padding + blocks.length) % blocks.length 190 const nextIndex = currentIndex === -1 ? 0 : (currentIndex + padding + blocks.length) % blocks.length
191 const nextBlock = blocks[nextIndex] 191 const nextBlock = blocks[nextIndex]
192 blocks.forEach(b=>b.classList.remove('focus')) 192 blocks.forEach(b => b.classList.remove('focus'))
193 nextBlock?.classList?.add('focus') 193 nextBlock?.classList?.add('focus')
194 nextBlock.scrollIntoView({behavior: 'smooth', block: "nearest"}) 194 nextBlock.scrollIntoView({ behavior: 'smooth', block: "nearest" })
195} 195}
196 196
197function removeBlockFocus() { 197function removeBlockFocus() {
198 this.blocks.forEach(b=>b.classList.remove('focus')) 198 this.blocks.forEach(b => b.classList.remove('focus'))
199} 199}
200 200
201export const generateMaps = (container, callback) => { 201export const generateMaps = (container, callback) => {