diff --git a/src/store.js b/src/store.js index f7113ad..e415524 100644 --- a/src/store.js +++ b/src/store.js @@ -115,18 +115,22 @@ export default new Vuex.Store({ }, actions: { - navigateLeft({ commit, state }) { + navigateLeft({ commit, state }, toEnd = false) { if (state.isNavigating || state.disableNavigation) return; commit("SET_NAVIGATING", true); + if (toEnd) return commit("SET_CURRENT_LIST", 0); + if (state.currentList - 1 < 0) commit("SET_CURRENT_LIST", state.groupListCounts[state.currentGroup] - 1); else commit("SET_CURRENT_LIST", state.currentList - 1); }, - navigateRight({ commit, state }) { + navigateRight({ commit, state }, toEnd = false) { if (state.isNavigating || state.disableNavigation) return; commit("SET_NAVIGATING", true); + if (toEnd) return commit("SET_CURRENT_LIST", state.groupListCounts[state.currentGroup] - 1); + if (state.currentList + 1 > state.groupListCounts[state.currentGroup] - 1) commit("SET_CURRENT_LIST", 0); else commit("SET_CURRENT_LIST", state.currentList + 1); }, diff --git a/src/views/ViewBoard.vue b/src/views/ViewBoard.vue index 698325a..c3b1782 100644 --- a/src/views/ViewBoard.vue +++ b/src/views/ViewBoard.vue @@ -147,6 +147,14 @@ export default { case 69: // E // this.$store.dispatch("editListTitle"); break; + + case 33: // Page Up + this.$store.dispatch("navigateLeft", true); + break; + + case 34: // Page Down + this.$store.dispatch("navigateRight", true); + break; } } }