Added events to show and hide the preview pane.
This commit is contained in:
parent
c3ca281ea7
commit
1e7f0fd8f1
|
@ -30,6 +30,16 @@ export default Ember.Component.extend({
|
||||||
_setupPreview() {
|
_setupPreview() {
|
||||||
const val = (this.site.mobileView ? false : (this.keyValueStore.get('composer.showPreview') || 'true'));
|
const val = (this.site.mobileView ? false : (this.keyValueStore.get('composer.showPreview') || 'true'));
|
||||||
this.set('showPreview', val === 'true');
|
this.set('showPreview', val === 'true');
|
||||||
|
|
||||||
|
this.appEvents.on('composer:show-preview', () => {
|
||||||
|
this.set('showPreview', true);
|
||||||
|
this.keyValueStore.set({ key: 'composer.showPreview', value: true });
|
||||||
|
});
|
||||||
|
|
||||||
|
this.appEvents.on('composer:hide-preview', () => {
|
||||||
|
this.set('showPreview', false);
|
||||||
|
this.keyValueStore.set({ key: 'composer.showPreview', value: false });
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed('site.mobileView', 'showPreview')
|
@computed('site.mobileView', 'showPreview')
|
||||||
|
@ -445,6 +455,8 @@ export default Ember.Component.extend({
|
||||||
@on('willDestroyElement')
|
@on('willDestroyElement')
|
||||||
_composerClosed() {
|
_composerClosed() {
|
||||||
this.appEvents.trigger('composer:will-close');
|
this.appEvents.trigger('composer:will-close');
|
||||||
|
this.appEvents.off('composer:show-preview');
|
||||||
|
this.appEvents.off('composer:hide-preview');
|
||||||
Ember.run.next(() => {
|
Ember.run.next(() => {
|
||||||
$('#main-outlet').css('padding-bottom', 0);
|
$('#main-outlet').css('padding-bottom', 0);
|
||||||
// need to wait a bit for the "slide down" transition of the composer
|
// need to wait a bit for the "slide down" transition of the composer
|
||||||
|
|
Loading…
Reference in New Issue