]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/tabs.js
respective book and chapter structure added.
[bookstack] / resources / js / components / tabs.js
index c3788c74795018acd4090571c0a4e1abcb032cb4..f0fc058ced7fd8377123f831ac93c631d27d4952 100644 (file)
@@ -70,7 +70,8 @@ export class Tabs extends Component {
     }
 
     activate() {
-        this.show(this.panels[0].id);
+        const panelToShow = this.panels.find(p => !p.hasAttribute('hidden')) || this.panels[0];
+        this.show(panelToShow.id);
         this.tabList.toggleAttribute('hidden', false);
     }