Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: ui/webui/resources/js/cr/ui/tabs.js

Issue 2947013002: TabBox will now select hidden tabs through arrow keys.
Patch Set: Updates for calamity. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/tabs.js
diff --git a/ui/webui/resources/js/cr/ui/tabs.js b/ui/webui/resources/js/cr/ui/tabs.js
index deccce91703b6198621dd4ee191061b26f149262..17eb0bf5d854daf14e86dfc8551ad413eacacec0 100644
--- a/ui/webui/resources/js/cr/ui/tabs.js
+++ b/ui/webui/resources/js/cr/ui/tabs.js
@@ -171,7 +171,13 @@ cr.define('cr.ui', function() {
var count = this.children.length;
var tabbox = getTabBox(this);
var index = tabbox.selectedIndex;
- tabbox.selectedIndex = (index + delta + count) % count;
+
+ // Select next visible tab. Does nothing if no other tabs are visible.
+ var next = index;
+ do {
+ next = (next + delta + count) % count;
+ } while (this.children[next].hidden && index != next);
+ tabbox.selectedIndex = next;
// Show focus outline since we used the keyboard.
this.focusOutlineManager_.visible = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698