| Index: chrome/browser/resources/uber/uber_frame.js
|
| diff --git a/chrome/browser/resources/uber/uber_frame.js b/chrome/browser/resources/uber/uber_frame.js
|
| index 8c5bb3bfe5c6be5c5c40373a6532f72a720c66d0..c4a5aea27dca4d66cfea60bd8c6650384b72b084 100644
|
| --- a/chrome/browser/resources/uber/uber_frame.js
|
| +++ b/chrome/browser/resources/uber/uber_frame.js
|
| @@ -77,14 +77,22 @@ cr.define('uber_frame', function() {
|
| var navItem =
|
| document.querySelector('li[controls="' + params.pageId + '"]');
|
| setSelection(navItem);
|
| + showNavItems();
|
| + }
|
| +
|
| + /**
|
| + * @return {Element} The currently selected nav item, if any.
|
| + */
|
| + function getSelectedNavItem() {
|
| + return document.querySelector('li.selected');
|
| }
|
|
|
| /**
|
| * Sets selection on the given nav item.
|
| - * @param {boolean} newSelection The item to be selected.
|
| + * @param {Element} newSelection The item to be selected.
|
| */
|
| function setSelection(newSelection) {
|
| - var lastSelectedNavItem = document.querySelector('li.selected');
|
| + var lastSelectedNavItem = getSelectedNavItem();
|
| if (lastSelectedNavItem !== newSelection) {
|
| newSelection.classList.add('selected');
|
| if (lastSelectedNavItem)
|
| @@ -93,6 +101,20 @@ cr.define('uber_frame', function() {
|
| }
|
|
|
| /**
|
| + * Shows nav items belonging to the same group as the selected item.
|
| + */
|
| + function showNavItems() {
|
| + var navItems = document.querySelectorAll('li');
|
| + var selectedNavItem = getSelectedNavItem();
|
| + assert(selectedNavItem);
|
| +
|
| + var selectedGroup = selectedNavItem.getAttribute('group');
|
| + for (var i = 0; i < navItems.length; ++i) {
|
| + navItems[i].hidden = navItems[i].getAttribute('group') != selectedGroup;
|
| + }
|
| + }
|
| +
|
| + /**
|
| * Adjusts this frame's content to scrolls from the outer frame. This is done
|
| * to obscure text in RTL as a user scrolls over the content of this frame (as
|
| * currently RTL scrollbars still draw on the right).
|
| @@ -124,7 +146,7 @@ cr.define('uber_frame', function() {
|
| }
|
|
|
| /**
|
| - * @return {Object} The currently selected iframe container.
|
| + * @return {Element} The currently selected iframe container.
|
| * @private
|
| */
|
| function getSelectedIframe() {
|
|
|