diff options
author | Avi Dessauer <avi.the.coder@gmail.com> | 2019-08-21 06:03:31 -0400 |
---|---|---|
committer | Alexey Kiryushin <alexey.a.kiryushin@gmail.com> | 2019-08-21 13:03:31 +0300 |
commit | af41ab40e1fc4888d1873a9ffe681ddafdfb4ee0 (patch) | |
tree | 219315a1ef02ae0d0f21889e7b88e08318b308a2 /javascript/app/components/infinite-list.js | |
parent | 5295ac7f7f26c3a43f0fe9b9c826e876b29cf666 (diff) |
Delete trailing whitespace (#42)
Diffstat (limited to 'javascript/app/components/infinite-list.js')
-rw-r--r-- | javascript/app/components/infinite-list.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/javascript/app/components/infinite-list.js b/javascript/app/components/infinite-list.js index b73b6d4..02e1943 100644 --- a/javascript/app/components/infinite-list.js +++ b/javascript/app/components/infinite-list.js @@ -10,34 +10,34 @@ function initialize(component) { pageNumber = 1; } -export default Component.extend({ +export default Component.extend({ renderedElements : [], init() { this._super(...arguments); initialize(this); }, - elementsObserver : observer('elements',function() { + elementsObserver : observer('elements',function() { initialize(this); const containerElement = document.getElementById(this.get('containerElementId')); - if(containerElement) { + if(containerElement) { containerElement.scrollTop = 0; } }), didInsertElement() { const containerElement = document.getElementById(this.get('containerElementId')); if(containerElement) { - const component = this; + const component = this; containerElement.onscroll = function() { const perPage = component.get('perPage'); const elements = component.get('elements'); - + if(!updating && (pageNumber * perPage < elements.length) && (containerElement.scrollTop + containerElement.offsetHeight > component.element.offsetHeight - 100)) { - + updating = true; - run.next(component,() => { + run.next(component,() => { const newElements = elements.slice(pageNumber * perPage,(pageNumber + 1) * perPage); component.get('renderedElements').pushObjects(newElements); pageNumber ++; |