From 35a3f7c9a6e46d08c057aa8d6e678e64d1e9758e Mon Sep 17 00:00:00 2001 From: Fran Worley Date: Tue, 21 May 2019 11:57:16 +0100 Subject: [PATCH] [BREAKING] update ember-in-viewport - changes event action name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit because we have an action named inViewport this now seems to be conflicting with the service imported in the inViewport mixin. Here I’m suggesting that we rename our action to ‘enterViewport’ as it is the opposite of the other action ‘exitViewport’. Obviously this is a breaking change as anyone using the existing action will need to rename it. Note: Currently we have a test failure yet to resolve from onScrolledToBottom --- addon/components/lt-body.js | 4 ++-- addon/components/lt-infinity.js | 2 +- addon/templates/components/lt-body.hbs | 2 +- package.json | 2 +- tests/integration/components/lt-infinity-test.js | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addon/components/lt-body.js b/addon/components/lt-body.js index 48829b98..3f718042 100644 --- a/addon/components/lt-body.js +++ b/addon/components/lt-body.js @@ -529,9 +529,9 @@ export default Component.extend({ /** * lt-infinity action to determine if component is still in viewport - * @event inViewport + * @event enterViewport */ - inViewport() { + enterViewport() { this.set('isInViewport', true); }, /** diff --git a/addon/components/lt-infinity.js b/addon/components/lt-infinity.js index 03dc102a..b36aa837 100644 --- a/addon/components/lt-infinity.js +++ b/addon/components/lt-infinity.js @@ -32,7 +32,7 @@ export default Component.extend(InViewportMixin, { }, didEnterViewport() { - get(this, 'inViewport')(); + get(this, 'enterViewport')(); }, didExitViewport() { diff --git a/addon/templates/components/lt-body.hbs b/addon/templates/components/lt-body.hbs index ae7059cc..cdb6bb0c 100644 --- a/addon/templates/components/lt-body.hbs +++ b/addon/templates/components/lt-body.hbs @@ -59,7 +59,7 @@ {{#if onScrolledToBottom}} {{lt.infinity rows=rows - inViewport=(action "inViewport") + enterViewport=(action "enterViewport") exitViewport=(action "exitViewport") scrollableContent=".lt-scrollable"}} {{/if}} diff --git a/package.json b/package.json index 8a86b350..f5a92cfe 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "ember-cli-htmlbars": "^2.0.3", "ember-cli-string-helpers": "^1.8.1", "ember-get-config": "^0.2.4", - "ember-in-viewport": "~3.0.3", + "ember-in-viewport": "^3.5.5", "ember-scrollable": "^0.5.2", "ember-truth-helpers": "^2.0.0", "ember-wormhole": "^0.5.5" diff --git a/tests/integration/components/lt-infinity-test.js b/tests/integration/components/lt-infinity-test.js index 44197a74..c38dac98 100644 --- a/tests/integration/components/lt-infinity-test.js +++ b/tests/integration/components/lt-infinity-test.js @@ -7,9 +7,9 @@ module('Integration | Component | lt infinity', function(hooks) { setupRenderingTest(hooks); test('it renders', async function(assert) { - this.inViewport = () => {}; + this.enterViewport = () => {}; this.exitViewport = () => {}; - await render(hbs`{{lt-infinity inViewport=inViewport exitViewport=exitViewport}}`); + await render(hbs`{{lt-infinity enterViewport=enterViewport exitViewport=exitViewport}}`); assert.equal(find('*').textContent.trim(), ''); }); });