2017-08-22 10:53:26 +03:00
|
|
|
import Component from '@ember/component';
|
2017-08-02 10:05:59 +03:00
|
|
|
import InViewportMixin from 'ember-in-viewport';
|
|
|
|
|
|
|
|
export default Component.extend(InViewportMixin, {
|
|
|
|
|
|
|
|
onEnterViewport() {},
|
|
|
|
|
|
|
|
didInsertElement() {
|
|
|
|
let offset = this.get('triggerOffset');
|
|
|
|
|
|
|
|
this.set('viewportSpy', true);
|
|
|
|
this.set('viewportTolerance', {
|
|
|
|
top: offset,
|
|
|
|
bottom: offset,
|
|
|
|
left: offset,
|
|
|
|
right: offset
|
|
|
|
});
|
|
|
|
|
|
|
|
this._super(...arguments);
|
|
|
|
},
|
|
|
|
|
|
|
|
didEnterViewport() {
|
|
|
|
return this.onEnterViewport();
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|