fix: Persist initialized config

This commit is contained in:
1ambda 2017-03-20 18:15:45 +09:00
parent f1f6b0ce2d
commit 912b5b7cef
2 changed files with 6 additions and 0 deletions

View file

@ -258,6 +258,7 @@ export function initializeConfig(config, spec) {
const currentVersion = JSON.stringify(spec)
if (!config.spec || !config.spec.version || config.spec.version !== currentVersion) {
spec.version = currentVersion
spec.initialized = true
delete config.chart /** Object: contains current, available chart */
delete config.spec /** Object: axis, parameter spec for each chart */
config.panel = { columnPanelOpened: true, parameterPanelOpened: false, }

View file

@ -41,6 +41,11 @@ class AdvancedTransformation extends Transformation {
const self = this; /** for closure */
const configInstance = self.config; /** for closure */
if (self.spec.initialized) {
self.spec.initialized = false
self.emitConfig(configInstance)
}
return {
template: SETTING_TEMPLATE,
scope: {