]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/expand-toggle.js
Add optional OIDC avatar fetching from the “picture” claim
[bookstack] / resources / js / components / expand-toggle.js
index 76928623d3bb7b70bf3b7ead7bcd2f99b4bc683e..29173a058293d99f88ed25390892961ea39e92e1 100644 (file)
@@ -1,9 +1,9 @@
-import {slideUp, slideDown} from '../services/animations';
+import {slideUp, slideDown} from '../services/animations.ts';
 import {Component} from './component';
 
 export class ExpandToggle extends Component {
 
-    setup(elem) {
+    setup() {
         this.targetSelector = this.$opts.targetSelector;
         this.isOpen = this.$opts.isOpen === 'true';
         this.updateEndpoint = this.$opts.updateEndpoint;
@@ -25,7 +25,8 @@ export class ExpandToggle extends Component {
 
         const matchingElems = document.querySelectorAll(this.targetSelector);
         for (const match of matchingElems) {
-            this.isOpen ? this.close(match) : this.open(match);
+            const action = this.isOpen ? this.close : this.open;
+            action(match);
         }
 
         this.isOpen = !this.isOpen;