Made changes as per review.

This commit is contained in:
Bianca Nenciu 2017-07-10 23:28:35 +01:00
parent 1e7f0fd8f1
commit 375eb290b9
1 changed files with 5 additions and 3 deletions

View File

@ -33,12 +33,10 @@ export default Ember.Component.extend({
this.appEvents.on('composer:show-preview', () => { this.appEvents.on('composer:show-preview', () => {
this.set('showPreview', true); this.set('showPreview', true);
this.keyValueStore.set({ key: 'composer.showPreview', value: true });
}); });
this.appEvents.on('composer:hide-preview', () => { this.appEvents.on('composer:hide-preview', () => {
this.set('showPreview', false); this.set('showPreview', false);
this.keyValueStore.set({ key: 'composer.showPreview', value: false });
}); });
}, },
@ -52,6 +50,11 @@ export default Ember.Component.extend({
return showPreview ? I18n.t('composer.hide_preview') : I18n.t('composer.show_preview'); return showPreview ? I18n.t('composer.hide_preview') : I18n.t('composer.show_preview');
}, },
@observes('showPreview')
showPreviewChanged() {
this.keyValueStore.set({ key: 'composer.showPreview', value: this.get('showPreview') });
},
@computed @computed
markdownOptions() { markdownOptions() {
return { return {
@ -498,7 +501,6 @@ export default Ember.Component.extend({
togglePreview() { togglePreview() {
this.toggleProperty('showPreview'); this.toggleProperty('showPreview');
this.keyValueStore.set({ key: 'composer.showPreview', value: this.get('showPreview') });
}, },
extraButtons(toolbar) { extraButtons(toolbar) {