Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 3.8 and prep for modifiers #178

Merged
merged 10 commits into from
Mar 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/node_modules/

# misc
/.env*
/.pnp*
/.sass-cache
/connect.lock
/coverage/
Expand Down
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
/.bowerrc
/.editorconfig
/.ember-cli
/.env*
/.eslintignore
/.eslintrc.js
/.gitignore
/.watchmanconfig
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/config/ember-try.js
/CONTRIBUTING.md
/ember-cli-build.js
/testem.js
/tests/
Expand Down
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ env:
# See https://git.io/vdao3 for details.
- JOBS=1

branches:
only:
- master
# npm version tags
- /^v\d+\.\d+\.\d+/

jobs:
fail_fast: true
allow_failures:
Expand All @@ -35,8 +41,8 @@ jobs:

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- env: EMBER_TRY_SCENARIO=ember-lts-2.16
- env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-lts-3.4
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
Expand Down
22 changes: 18 additions & 4 deletions addon/mixins/in-viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ export default Mixin.create({
threshold: get(this, 'intersectionThreshold')
});

get(this, '_observerAdmin').add(element, bind(this, this._onEnterIntersection), bind(this, this._onExitIntersection), this._observerOptions, this.scrollableArea);
get(this, '_observerAdmin').add(
element,
bind(this, this._onEnterIntersection),
bind(this, this._onExitIntersection),
this._observerOptions,
this.scrollableArea
);
},

/**
Expand All @@ -172,8 +178,12 @@ export default Mixin.create({
return;
}

const height = scrollableArea ? scrollableArea.offsetHeight + scrollableArea.getBoundingClientRect().top : window.innerHeight;
const width = scrollableArea ? scrollableArea.offsetWidth + scrollableArea.getBoundingClientRect().left : window.innerWidth;
const height = scrollableArea
? scrollableArea.offsetHeight + scrollableArea.getBoundingClientRect().top
: window.innerHeight;
const width = scrollableArea
? scrollableArea.offsetWidth + scrollableArea.getBoundingClientRect().left
: window.innerWidth;
const boundingClientRect = element.getBoundingClientRect();

if (boundingClientRect) {
Expand Down Expand Up @@ -355,7 +365,11 @@ export default Mixin.create({

// if IntersectionObserver
if (get(this, 'viewportUseIntersectionObserver') && get(this, 'viewportEnabled')) {
get(this, '_observerAdmin').unobserve(this.element, get(this, '_observerOptions'), get(this, 'scrollableArea'));
get(this, '_observerAdmin').unobserve(
this.element,
get(this, '_observerOptions'),
get(this, 'scrollableArea')
);
}

// if rAF
Expand Down
10 changes: 5 additions & 5 deletions addon/services/-observer-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ export default class ObserverAdmin extends Service {
/** @private **/
init() {
this._super(...arguments);
this._observerAdmin = new IntersectionObserverAdmin();
this.ioAdmin = new IntersectionObserverAdmin();
}

add(...args) {
return this._observerAdmin.observe(...args);
return this.ioAdmin.observe(...args);
}

unobserve(...args) {
return this._observerAdmin.unobserve(...args);
return this.ioAdmin.unobserve(...args);
}

destroy(...args) {
this._observerAdmin.destroy(...args);
this._observerAdmin = null;
this.ioAdmin.destroy(...args);
this.ioAdmin = null;
}
}
16 changes: 8 additions & 8 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,22 @@ module.exports = function() {
return {
scenarios: [
{
name: 'ember-lts-2.16',
name: 'ember-lts-2.18',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true })
},
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1',
'ember-source': '~2.16.0'
'ember-source': '~2.18.0'
}
}
},
{
name: 'ember-lts-2.18',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true })
},
name: 'ember-lts-3.4',
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1',
'ember-source': '~2.18.0'
'ember-source': '~3.4.0'
}
}
},
Expand Down Expand Up @@ -58,6 +54,10 @@ module.exports = function() {
}
}
},
// The default `.travis.yml` runs this scenario via `npm test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: 'ember-default',
npm: {
Expand Down
Loading