This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/topic-navigation.js.es6

27 lines
562 B
JavaScript

export default Ember.Component.extend({
showTimeline: null,
_checkSize() {
const width = $(window).width();
this.set('showTimeline', width > 960);
},
didInsertElement() {
this._super();
if (!this.site.mobileView) {
$(window).on('resize.discourse-topic-navigation', () => this._checkSize());
this._checkSize();
} else {
this.set('showTimeline', false);
}
},
willDestroyElement() {
this._super();
if (!this.site.mobileView) {
$(window).off('resize.discourse-topic-navigation');
}
}
});