Uses ember-in-viewport in combination with min-height components to occlude fields.
Effectively scales to any size, the main problem being that detecting outside of the viewport would be preferable (no gap in the loading)
Created
September 28, 2016 16:38
-
-
Save sglanzer-fire/2420939916a1cd00472c13ebe587c544 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .viewport { | |
| min-height: 500px; | |
| } | |
| input { | |
| display: block | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| fourGrand: Ember.computed(function() { | |
| return Array(40000).fill('hi') | |
| }), | |
| fourGrandPaged: Ember.computed('fourGrand', function() { | |
| const fourGrand = this.get('fourGrand') | |
| const fourGrandPaged = [] | |
| for (let index = 0; index < 4000; index += 50) { | |
| fourGrandPaged.addObject(fourGrand.slice(index, index + 50)) | |
| } | |
| return fourGrandPaged | |
| }) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember' | |
| import InViewportMixin from 'ember-in-viewport' | |
| export default Ember.Component.extend(InViewportMixin, { | |
| classNames: ['viewport'], | |
| didEnterViewport() { | |
| this.set('inViewport', true) | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment