mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 03:12:54 +03:00
e8a28734bd
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
24 lines
664 B
JavaScript
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));
|
|
}
|
|
});
|