X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a6633642232efd164d4708967ab59e498fbff896..refs/pull/3994/head:/resources/js/components/attachments.js diff --git a/resources/js/components/attachments.js b/resources/js/components/attachments.js index 6dcfe9f12..b4e400aeb 100644 --- a/resources/js/components/attachments.js +++ b/resources/js/components/attachments.js @@ -1,10 +1,7 @@ -/** - * Attachments - * @extends {Component} - */ import {showLoading} from "../services/dom"; +import {Component} from "./component"; -class Attachments { +export class Attachments extends Component { setup() { this.container = this.$el; @@ -46,10 +43,12 @@ class Attachments { reloadList() { this.stopEdit(); - this.mainTabs.components.tabs.show('items'); + /** @var {Tabs} */ + const tabs = window.$components.firstOnElement(this.mainTabs, 'tabs'); + tabs.show('items'); window.$http.get(`/attachments/get/page/${this.pageId}`).then(resp => { this.list.innerHTML = resp.data; - window.components.init(this.list); + window.$components.init(this.list); }); } @@ -66,7 +65,7 @@ class Attachments { showLoading(this.editContainer); const resp = await window.$http.get(`/attachments/edit/${id}`); this.editContainer.innerHTML = resp.data; - window.components.init(this.editContainer); + window.$components.init(this.editContainer); } stopEdit() { @@ -74,6 +73,4 @@ class Attachments { this.listContainer.classList.remove('hidden'); } -} - -export default Attachments; \ No newline at end of file +} \ No newline at end of file