diff --git a/public/js/components/Dashboard/Admin/Presets.js b/public/js/components/Dashboard/Admin/Presets.js index a66159466..98f4fad88 100644 --- a/public/js/components/Dashboard/Admin/Presets.js +++ b/public/js/components/Dashboard/Admin/Presets.js @@ -12,16 +12,25 @@ export default { dashboard: String, widgets: Array }, - data: () => ({ - funktionen: {}, - sections: [], - tmpLoading: '' - }), + data() { + return { + funktionen: {}, + sections: [], + tmpLoading: '' + }; + }, computed: { pickerWidgets() { return this.widgets.filter(widget => widget.allowed); } }, + watch: { + dashboard() { + // TODO(chris): this should be done without a watcher + this.loadSections({target:this.$refs.funktionenList}); + this.loadFunktionen(); + } + }, methods: { widgetAdd(widget, section_name) { this.$refs.widgetpicker.getWidget().then(widget_id => { @@ -149,7 +158,6 @@ export default { } }) .catch(this.$fhcAlert.handleSystemError); - }, loadFunktionen() { this.$api @@ -163,17 +171,17 @@ export default { created() { this.loadFunktionen(); }, - watch: { - dashboard() { - // TODO(chris): this should be done without a watcher - this.loadSections({target:this.$refs.funktionenList}); - this.loadFunktionen(); - } - }, - template: `