diff --git a/application/controllers/dashboard/Config.php b/application/controllers/dashboard/Config.php index c5b912e1f..213781b74 100644 --- a/application/controllers/dashboard/Config.php +++ b/application/controllers/dashboard/Config.php @@ -76,7 +76,7 @@ class Config extends Auth_Controller $this->terminateWithJsonError('preset could not be saved'); } - $this->outputJsonSuccess(array('msg' => 'preset successfully stored.')); + $this->outputJsonSuccess(array('msg' => 'preset successfully stored.', 'data' => $preset_decoded)); } public function removeWidgetFromPreset() diff --git a/public/js/components/Dashboard/Admin/Presets.js b/public/js/components/Dashboard/Admin/Presets.js index 19052171f..5052d157a 100644 --- a/public/js/components/Dashboard/Admin/Presets.js +++ b/public/js/components/Dashboard/Admin/Presets.js @@ -27,6 +27,7 @@ export default { widgetAdd(section_name, widget) { this.$refs.widgetpicker.getWidget().then(widget_id => { widget.widget = widget_id; + delete widget.custom; let loading = {...widget}; loading.loading = true; this.sections.forEach(section => { @@ -41,6 +42,7 @@ export default { }).then(result => { let newId = Object.keys(result.data.retval.data.widgets[section_name]).pop(); widget.id = newId; + widget.custom = 1; this.sections.forEach(section => { if (section.name == section_name) { section.widgets.splice(section.widgets.indexOf(loading),1);