Skip to content

Commit

Permalink
feat: Switch to Custom config when config is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
finom committed Oct 13, 2016
1 parent a8c1b73 commit d3f10b7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ module.exports = new class Application extends MatreshkaObject {
evt.preventDefault();
const results = lint(this.code, this.toJSON());

this.set({ results })

console.log(results);
this.set({ results });
},
'change:parserName': () => setParser(this.parserName),
'rules@modify': evt => console.log('tablo')
'rules@rulechange': () => {
this.set('configName', '', { silent: true });
}
});
}
}
10 changes: 7 additions & 3 deletions src/rules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ export default class Rules extends MatreshkaArray {
.calc('useRecommended', {
object: parent,
key: 'useRecommended'
}, null, { debounceCalc: false });

this.recreate(plugins);
}, null, { debounceCalc: false })
.on({
'*.*@rulechange': () => {
this.trigger('rulechange')
}
})
.recreate(plugins);
}

update(rules) {
Expand Down
3 changes: 2 additions & 1 deletion src/rules/rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default class Rule extends MatreshkaObject {
source: 'dynamicValue',
handler: value => JSON.stringify(value, null, '\t')
}
});
})
.on('click::isOn', () => this.trigger('rulechange'));
}
}

0 comments on commit d3f10b7

Please sign in to comment.