Ghost/core/client/app/components/gh-content-view-container.js
Kevin Ansfield e8a28734bd Mobile markdown/preview tabs
refs #5652
- on mobile, add Markdown/Preview links to the editor footer that switch between the respective views
- temporary resolution to the inability to upload on mobile without access to the preview
2015-09-01 18:14:40 +01:00

24 lines
664 B
JavaScript

import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'section',
classNames: ['gh-view', 'content-view-container'],
previewIsHidden: false,
resizeService: Ember.inject.service(),
calculatePreviewIsHidden: function () {
if (this.$('.content-preview').length) {
this.set('previewIsHidden', !this.$('.content-preview').is(':visible'));
}
},
didInsertElement: function () {
this._super(...arguments);
this.calculatePreviewIsHidden();
this.get('resizeService').on('debouncedDidResize',
Ember.run.bind(this, this.calculatePreviewIsHidden));
}
});