diff options
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/js/launcher.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/app/js/launcher.js b/src/app/js/launcher.js index dc99792..546b647 100644 --- a/src/app/js/launcher.js +++ b/src/app/js/launcher.js @@ -203,18 +203,30 @@ launcher.relative_section = (direction) => { } } + let new_section; + // if we're going left, and a previous section was found, click it if (direction == "left" && prev_section) { - prev_section.click(); + new_section = prev_section; } else if (direction == "right") { // click the next section, if one was found, otherwise just // assume that the first section is the next section, as the // active section is likely just the last section, so we wrap // around instead if (next_section) { - next_section.click(); + new_section = next_section; } else if (sections[0]) { - sections[0].click(); + new_section = sections[0]; + } + } + + if (new_section) { + new_section.click(); + + // if there's an active selection, we select the new section, as + // that selection may be in a section that's now hidden + if (document.querySelector(".active-selection")) { + navigate.selection(new_section); } } } |