diff options
Diffstat (limited to 'src/dumbyUtils.mjs')
-rw-r--r-- | src/dumbyUtils.mjs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/dumbyUtils.mjs b/src/dumbyUtils.mjs index cfac00b..140d671 100644 --- a/src/dumbyUtils.mjs +++ b/src/dumbyUtils.mjs | |||
@@ -1,17 +1,12 @@ | |||
1 | export function focusNextMap(reverse = false) { | 1 | export function focusNextMap(reverse = false) { |
2 | const renderedList = Array.from( | 2 | const renderedList = this.utils.renderedMaps(); |
3 | this.htmlHolder.querySelectorAll('[data-render=fulfilled]'), | 3 | |
4 | ); | ||
5 | const mapNum = renderedList.length; | 4 | const mapNum = renderedList.length; |
6 | if (mapNum === 0) return; | 5 | if (mapNum === 0) return; |
7 | 6 | ||
8 | // Get current focused map element | 7 | // Get current focused map element |
9 | const currentFocus = this.container.querySelector('.mapclay.focus'); | 8 | const currentFocus = this.container.querySelector('.mapclay.focus'); |
10 | 9 | ||
11 | // Remove class name of focus for ALL candidates | ||
12 | // This may trigger animation | ||
13 | renderedList.forEach(ele => ele.classList.remove('focus')); | ||
14 | |||
15 | // Get next existing map element | 10 | // Get next existing map element |
16 | const padding = reverse ? -1 : 1; | 11 | const padding = reverse ? -1 : 1; |
17 | let nextIndex = currentFocus | 12 | let nextIndex = currentFocus |