Skip to content

Commit

Permalink
WEBUI-1215: enabled tab navigation through drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
swarnadipa-dev committed Aug 22, 2023
1 parent 8cf5fcf commit 4c22738
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions elements/nuxeo-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ Polymer({
on-iron-activate="_toggleDrawer"
aria-label$="[[i18n('app.drawer')]]"
aria-expanded="[[drawerOpened]]"
on-keyup="_toggleDrawer"
>
<nuxeo-slot name="DRAWER_ITEMS" model="[[actionContext]]"></nuxeo-slot>
<nuxeo-menu-icon
Expand Down Expand Up @@ -669,6 +670,9 @@ Polymer({
this.removeAttribute('unresolved');

Performance.mark('nuxeo-app.ready');
this.$.menu.addEventListener('keyup', (event) => {
this._toggleDrawer(event, { detail: { selected: event.target.getAttribute('name') } });
});
},

_resetTaskSelection() {
Expand Down Expand Up @@ -988,11 +992,14 @@ Polymer({
this.navigateTo('search', target.searchName);
},

_toggleDrawer(e) {
if (e.detail.selected && this._selected === e.detail.selected && this.drawerOpened) {
_toggleDrawer(e, selectedObj) {
const selectedItem = e.type === 'keyup' ? selectedObj : e;
const selectedItemDetailSelected =
selectedItem.detail && selectedItem.detail.selected ? selectedItem.detail.selected : 0;
if (this._selected === selectedItemDetailSelected && this.drawerOpened) {
this._closeDrawer();
} else {
this._selected = this.selectedTab = e.detail.selected;
this._selected = this.selectedTab = selectedItemDetailSelected;
this._openDrawer();
}
},
Expand Down

0 comments on commit 4c22738

Please sign in to comment.