Skip to content

Commit

Permalink
fix setup of defaultAttrs for paper-virtual-repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
panthony committed Jun 11, 2018
1 parent 666f06d commit c10abe3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions addon/components/paper-virtual-repeat.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { mapBy } from '@ember/object/computed';
import { run } from '@ember/runloop';
import { assign } from '@ember/polyfills';
import { observer, set, get, computed } from '@ember/object';
import RSVP from 'rsvp';
import { A as emberArray } from '@ember/array';
Expand All @@ -23,13 +24,6 @@ const VirtualRepeatComponent = VirtualEachComponent.extend({
}
},

defaultAttrs: computed(function() {
return {
scrollTimeout: 30,
height: 48
};
}),

size: computed('initialSize', 'items.[]', 'itemHeight', function() {
let itemSize = this.get('itemHeight');
let fullSize = this.get('items.length') * itemSize;
Expand Down Expand Up @@ -112,6 +106,14 @@ const VirtualRepeatComponent = VirtualEachComponent.extend({
return Math.ceil(this.get('itemHeight') ? size / this.get('itemHeight') : 1) + EXTRA_ROW_PADDING;
}).readOnly(),

init() {
this._super(...arguments);
this.set('defaultAttrs', assign({}, this.get('defaultAttrs') || {}, {
scrollTimeout: 30,
height: 48
}));
},

didInsertElement() {
this._super(...arguments);

Expand Down

0 comments on commit c10abe3

Please sign in to comment.