]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/editor-toolbox.js
Add optional OIDC avatar fetching from the “picture” claim
[bookstack] / resources / js / components / editor-toolbox.js
index 1f1fce9dcacb6978ecd68fe350d7368baabf5faa..ddb4ff39c7686a285247466b708d32b2f76fbbba 100644 (file)
@@ -8,15 +8,12 @@ export class EditorToolbox extends Component {
         this.buttons = this.$manyRefs.tabButton;
         this.contentElements = this.$manyRefs.tabContent;
         this.toggleButton = this.$refs.toggle;
+        this.editorWrapEl = this.container.closest('.page-editor');
 
         this.setupListeners();
 
         // Set the first tab as active on load
         this.setActiveTab(this.contentElements[0].dataset.tabContent);
-
-        setTimeout(() => {
-            this.setActiveTab('files', true);
-        }, 500);
     }
 
     setupListeners() {
@@ -34,8 +31,9 @@ export class EditorToolbox extends Component {
 
     toggle() {
         this.container.classList.toggle('open');
-        const expanded = this.container.classList.contains('open') ? 'true' : 'false';
-        this.toggleButton.setAttribute('aria-expanded', expanded);
+        const isOpen = this.container.classList.contains('open');
+        this.toggleButton.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
+        this.editorWrapEl.classList.toggle('toolbox-open', isOpen);
     }
 
     setActiveTab(tabName, openToolbox = false) {