X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/cb10ad804f046d652950dbafb3d549875b4f898f..refs/pull/5429/head:/resources/js/components/chapter-contents.js diff --git a/resources/js/components/chapter-contents.js b/resources/js/components/chapter-contents.js index c824d0f78..6b0707bdd 100644 --- a/resources/js/components/chapter-contents.js +++ b/resources/js/components/chapter-contents.js @@ -1,9 +1,7 @@ -import {slideUp, slideDown} from "../services/animations"; +import {slideUp, slideDown} from '../services/animations.ts'; +import {Component} from './component'; -/** - * @extends {Component} - */ -class ChapterContents { +export class ChapterContents extends Component { setup() { this.list = this.$refs.list; @@ -29,9 +27,11 @@ class ChapterContents { click(event) { event.preventDefault(); - this.isOpen ? this.close() : this.open(); + if (this.isOpen) { + this.close(); + } else { + this.open(); + } } } - -export default ChapterContents;