From 5c2e12b7f8cdc48e1ddb41710e60144f5c778cda Mon Sep 17 00:00:00 2001 From: Florrie Date: Tue, 15 Oct 2019 18:18:26 -0300 Subject: Make next/previous tab controls wrap around --- ui.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ui.js') diff --git a/ui.js b/ui.js index 368c8ea..a7ad672 100644 --- a/ui.js +++ b/ui.js @@ -3271,11 +3271,17 @@ class Tabber extends FocusElement { nextTab() { this.currentElementIndex++ + if (this.currentElementIndex >= this.tabberElements.length) { + this.currentElementIndex = 0 + } this.updateVisibleElement() } previousTab() { this.currentElementIndex-- + if (this.currentElementIndex < 0) { + this.currentElementIndex = this.tabberElements.length - 1 + } this.updateVisibleElement() } -- cgit 1.3.0-6-gf8a5