Remove unused gh-infinite-scroll component and infinite-scroll mixin

no issue
- this component and mixin has been replaced by `ember-infinity`
This commit is contained in:
Kevin Ansfield 2017-08-03 10:06:58 +04:00 committed by Hannah Wolfe
parent 9ad5644031
commit 6ae881e918
4 changed files with 0 additions and 71 deletions

View File

@ -1,10 +0,0 @@
import Component from 'ember-component';
import InfiniteScrollMixin from 'ghost-admin/mixins/infinite-scroll';
export default Component.extend(InfiniteScrollMixin, {
actions: {
checkScroll() {
this._checkScroll();
}
}
});

View File

@ -1,42 +0,0 @@
import Mixin from 'ember-metal/mixin';
import run from 'ember-runloop';
export default Mixin.create({
isLoading: false,
triggerPoint: 100,
/**
* Determines if we are past a scroll point where we need to fetch the next page
*/
_checkScroll() {
let element = this.get('element');
let triggerPoint = this.get('triggerPoint');
let isLoading = this.get('isLoading');
// If we haven't passed our threshold or we are already fetching content, exit
if (isLoading || (element.scrollTop + element.clientHeight + triggerPoint <= element.scrollHeight)) {
return;
}
this.sendAction('fetch');
},
didInsertElement() {
this._super(...arguments);
let el = this.get('element');
el.onscroll = run.bind(this, this._checkScroll);
// run on load, on the offchance that the initial load
// did not fill the view.
this._checkScroll();
},
willDestroyElement() {
this._super(...arguments);
// turn off the scroll handler
this.get('element').onscroll = null;
}
});

View File

@ -1 +0,0 @@
{{yield (action "checkScroll")}}

View File

@ -1,18 +0,0 @@
/* jshint expr:true */
import EmberObject from 'ember-object';
import InfiniteScrollMixin from 'ghost-admin/mixins/infinite-scroll';
import {
describe,
it
} from 'mocha';
import {expect} from 'chai';
describe('Unit: Mixin: infinite-scroll', function () {
// Replace this with your real tests.
it('works', function () {
let InfiniteScrollObject = EmberObject.extend(InfiniteScrollMixin);
let subject = InfiniteScrollObject.create();
expect(subject).to.be.ok;
});
});