aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/dumbyUtils.mjs
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-10-04 23:12:06 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-10-04 23:12:09 +0800
commit574cefa7cf5490a483e4a480e1bc1bbffa0805de (patch)
treeed978444865149dd84cd9a786f04f50ddba5bd73 /src/dumbyUtils.mjs
parent9a0fdb914d50c32f062de58704b40ea1ceb23203 (diff)
style: reformat code
Diffstat (limited to 'src/dumbyUtils.mjs')
-rw-r--r--src/dumbyUtils.mjs10
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 */
9export function focusNextMap(reverse = false) { 9export 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 */
24export function focusNextBlock(reverse = false) { 24export 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 */
59export function focusDelay() { 59export 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 */
68export function switchToNextLayout(reverse = false) { 68export 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 */
84export function removeBlockFocus() { 84export function removeBlockFocus () {
85 this.blocks.forEach(b => b.classList.remove('focus')) 85 this.blocks.forEach(b => b.classList.remove('focus'))
86} 86}
87 87