diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-10-11 21:30:23 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-10-14 16:34:00 +0800 |
commit | 71ce6889d0a5359e63285d5ec3a299fd79b59778 (patch) | |
tree | 9c11885ef0489e063172a82a98d0232f6aa622fe /src/dumbyUtils.mjs | |
parent | a295061365349df7adf14d2ed8171a476f46eda9 (diff) |
docs: jsdoc
Diffstat (limited to 'src/dumbyUtils.mjs')
-rw-r--r-- | src/dumbyUtils.mjs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/dumbyUtils.mjs b/src/dumbyUtils.mjs index f0878cf..a449646 100644 --- a/src/dumbyUtils.mjs +++ b/src/dumbyUtils.mjs | |||
@@ -5,8 +5,7 @@ export const coordPattern = /^geo:([-]?[0-9.]+),([-]?[0-9.]+)/ | |||
5 | 5 | ||
6 | /** | 6 | /** |
7 | * focusNextMap. | 7 | * focusNextMap. |
8 | * | 8 | * @param {Boolean} reverse - focus previous map |
9 | * @param {Boolean} reverse -- focus previous map | ||
10 | */ | 9 | */ |
11 | export function focusNextMap (reverse = false) { | 10 | export function focusNextMap (reverse = false) { |
12 | const renderedList = this.utils.renderedMaps() | 11 | const renderedList = this.utils.renderedMaps() |
@@ -21,7 +20,7 @@ export function focusNextMap (reverse = false) { | |||
21 | /** | 20 | /** |
22 | * focusNextBlock. | 21 | * focusNextBlock. |
23 | * | 22 | * |
24 | * @param {Boolean} reverse -- focus previous block | 23 | * @param {Boolean} reverse - focus previous block |
25 | */ | 24 | */ |
26 | export function focusNextBlock (reverse = false) { | 25 | export function focusNextBlock (reverse = false) { |
27 | const blocks = this.blocks.filter(b => | 26 | const blocks = this.blocks.filter(b => |
@@ -44,7 +43,7 @@ export function focusNextBlock (reverse = false) { | |||
44 | * scrollToBlock. Smoothly scroll to target block. | 43 | * scrollToBlock. Smoothly scroll to target block. |
45 | * If block is bigger than viewport, then pick strategy wisely. | 44 | * If block is bigger than viewport, then pick strategy wisely. |
46 | * | 45 | * |
47 | * @param {HTMLElement} block -- Scroll to this element | 46 | * @param {HTMLElement} block - Scroll to this element |
48 | */ | 47 | */ |
49 | export const scrollToBlock = block => { | 48 | export const scrollToBlock = block => { |
50 | const parentRect = block.parentElement.getBoundingClientRect() | 49 | const parentRect = block.parentElement.getBoundingClientRect() |
@@ -65,7 +64,7 @@ export function focusDelay () { | |||
65 | /** | 64 | /** |
66 | * switchToNextLayout. | 65 | * switchToNextLayout. |
67 | * | 66 | * |
68 | * @param {Boolean} reverse -- Switch to previous one | 67 | * @param {Boolean} reverse - Switch to previous one |
69 | */ | 68 | */ |
70 | export function switchToNextLayout (reverse = false) { | 69 | export function switchToNextLayout (reverse = false) { |
71 | const layouts = this.layouts | 70 | const layouts = this.layouts |
@@ -297,9 +296,9 @@ const isAnchorVisible = anchor => { | |||
297 | /** | 296 | /** |
298 | * addAnchorByPoint. | 297 | * addAnchorByPoint. |
299 | * | 298 | * |
300 | * @param {point} options.point -- object has {x, y} for window coordinates | 299 | * @param {point} options.point - object has {x, y} for window coordinates |
301 | * @param {HTMLElement} options.map | 300 | * @param {HTMLElement} options.map |
302 | * @param {Function} options.validateAnchorName -- validate anchor name is OK to use | 301 | * @param {Function} options.validateAnchorName - validate anchor name is OK to use |
303 | */ | 302 | */ |
304 | export const addAnchorByPoint = ({ | 303 | export const addAnchorByPoint = ({ |
305 | defaultName, | 304 | defaultName, |