2015-08-28 11:52:38 +01:00
|
|
|
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 () {
|
2015-09-01 12:22:10 +01:00
|
|
|
if (this.$('.content-preview').length) {
|
|
|
|
this.set('previewIsHidden', !this.$('.content-preview').is(':visible'));
|
|
|
|
}
|
2015-08-28 11:52:38 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
didInsertElement: function () {
|
|
|
|
this._super(...arguments);
|
|
|
|
this.calculatePreviewIsHidden();
|
|
|
|
this.get('resizeService').on('debouncedDidResize',
|
|
|
|
Ember.run.bind(this, this.calculatePreviewIsHidden));
|
|
|
|
}
|
|
|
|
});
|