mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
6835681469
refs #5652 - add `ember-resize` addon that registers a single resize event handler and exposes it as a service and mixin - add a component that wraps the posts list and content preview and exposes a `previewIsHidden` property - use the `previewIsHidden` property in `gh-posts-list-item` to switch the item's link between the editor and the preview - add `display: none` to the preview pane when in mobile so that we can test it's visibility
21 lines
601 B
JavaScript
21 lines
601 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 () {
|
|
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));
|
|
}
|
|
});
|