Commit f4379038 authored by akiraohgaki's avatar akiraohgaki

Fix for sidebar

parent 4f622ec6
......@@ -42,9 +42,9 @@ export default class CollectiondialogComponent extends BaseComponent {
<app-page id="collection" slot="content">
<app-collectionsidebar slot="sidebar"></app-collectionsidebar>
<app-switchview slot="content">
<app-collectiondownload id="download"></app-collectiondownload>
<app-collectionupdate id="update"></app-collectionupdate>
<app-collectioninstalled id="installed"></app-collectioninstalled>
<app-collectionupdate id="update"></app-collectionupdate>
<app-collectiondownload id="download"></app-collectiondownload>
</app-switchview>
</app-page>
</app-dialog>
......@@ -68,14 +68,14 @@ export default class CollectiondialogComponent extends BaseComponent {
_handleCollectionsidebarSelect(event) {
const switchviewComponent = this.contentRoot.querySelector('app-switchview');
switch (event.detail.select) {
case 'download':
switchviewComponent.switch('download');
case 'installed':
switchviewComponent.switch('installed');
break;
case 'update':
switchviewComponent.switch('update');
break;
case 'installed':
switchviewComponent.switch('installed');
case 'download':
switchviewComponent.switch('download');
break;
}
}
......
......@@ -194,8 +194,18 @@ export default class CollectionsidebarComponent extends BaseComponent {
}
_viewHandler_ocsManager_installedItems(state) {
this.contentRoot.querySelector('nav ul[data-menu="category"]')
.innerHTML = this._categoryMenuItemsHtml(state);
const categoryMenu = this.contentRoot.querySelector('nav ul[data-menu="category"]');
const selectedMenuItem = categoryMenu.querySelector('a[data-selected]');
const installType = selectedMenuItem ? selectedMenuItem.getAttribute('data-install-type') : '';
categoryMenu.innerHTML = this._categoryMenuItemsHtml(state);
const menuItem = installType ? categoryMenu.querySelector(`a[data-install-type="${installType}"]`) : null;
if (menuItem) {
menuItem.click();
}
}
_viewHandler_ocsManager_updateAvailableItems(state) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment