FIX: eyeline was broken in dev

This commit is contained in:
Régis Hanol 2015-08-13 12:42:57 +02:00
parent 930d06673e
commit a8d20c623f
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ const Eyeline = function Eyeline(selector) {
};
Eyeline.prototype.update = function() {
if (Ember.Test) { return; }
if (Ember.testing) { return; }
const docViewTop = $(window).scrollTop(),
windowHeight = $(window).height(),
@ -60,7 +60,7 @@ Eyeline.prototype.update = function() {
// Call this when we know aren't loading any more elements. Mark the rest as seen
Eyeline.prototype.flushRest = function() {
if (Ember.Test) { return; }
if (Ember.testing) { return; }
const self = this;
$(this.selector).each(function(i, elem) {
return self.trigger('saw', { detail: $(elem) });

View File

@ -4,7 +4,7 @@ import Scrolling from 'discourse/mixins/scrolling';
// Provides the ability to load more items for a view which is scrolled to the bottom.
export default Ember.Mixin.create(Ember.ViewTargetActionSupport, Scrolling, {
scrolled: function() {
scrolled() {
const eyeline = this.get('eyeline');
if (eyeline) { eyeline.update(); }
},