ember-wormhole
Advanced tools
Comparing version 0.5.2 to 0.5.3
@@ -1,2 +0,5 @@ | ||
import Ember from 'ember'; | ||
import { alias } from '@ember/object/computed'; | ||
import Component from '@ember/component'; | ||
import { observer, computed } from '@ember/object'; | ||
import { run } from '@ember/runloop'; | ||
import layout from '../templates/components/ember-wormhole'; | ||
@@ -9,4 +12,2 @@ import { | ||
const { Component, computed, observer, run } = Ember; | ||
export default Component.extend({ | ||
@@ -18,3 +19,3 @@ layout, | ||
*/ | ||
to: computed.alias('destinationElementId'), | ||
to: alias('destinationElementId'), | ||
destinationElementId: null, | ||
@@ -46,30 +47,20 @@ destinationElement: computed('destinationElementId', 'renderInPlace', function() { | ||
// A prop to help in the mocking of didInsertElement timing for Fastboot | ||
this._didInsert = false; | ||
/* | ||
* didInsertElement does not fire in Fastboot, so we schedule this in | ||
* init to be run after render. Importantly, we want to run | ||
* appendToDestination after the child nodes have rendered. | ||
*/ | ||
run.schedule('afterRender', () => { | ||
if (this.isDestroyed) { return; } | ||
this._element = this._wormholeHeadNode.parentNode; | ||
if (!this._element) { | ||
throw new Error('The head node of a wormhole must be attached to the DOM'); | ||
} | ||
this._appendToDestination(); | ||
}); | ||
}, | ||
/* | ||
* didInsertElement does not fire in Fastboot. Here we use willRender and | ||
* a _didInsert property to approximate the timing. Importantly we want | ||
* to run appendToDestination after the child nodes have rendered. | ||
*/ | ||
willRender() { | ||
this._super(...arguments); | ||
if (!this._didInsert) { | ||
this._didInsert = true; | ||
run.schedule('afterRender', () => { | ||
if (this.isDestroyed) { return; } | ||
this._element = this._wormholeHeadNode.parentNode; | ||
if (!this._element) { | ||
throw new Error('The head node of a wormhole must be attached to the DOM'); | ||
} | ||
this._appendToDestination(); | ||
}); | ||
} | ||
}, | ||
willDestroyElement: function() { | ||
// not called in fastboot | ||
this._super(...arguments); | ||
this._didInsert = false; | ||
let { _wormholeHeadNode, _wormholeTailNode } = this; | ||
@@ -76,0 +67,0 @@ run.schedule('render', () => { |
@@ -6,4 +6,3 @@ /* | ||
import Ember from 'ember'; | ||
let getOwner = Ember.getOwner; | ||
import { getOwner } from '@ember/application'; | ||
@@ -10,0 +9,0 @@ export function getActiveElement() { |
# Change Log | ||
## [v0.5.2](https://github.com/yapplabs/ember-wormhole/tree/v0.5.2) (2017-06-11) | ||
[Full Changelog](https://github.com/yapplabs/ember-wormhole/compare/0.5.1...v0.5.2) | ||
## [0.5.3](https://github.com/yapplabs/ember-wormhole/tree/0.5.3) (2017-11-22) | ||
[Full Changelog](https://github.com/yapplabs/ember-wormhole/compare/0.5.2...0.5.3) | ||
**Merged pull requests:** | ||
- Update ember-cli and dependencies. Use ember modules. [\#100](https://github.com/yapplabs/ember-wormhole/pull/100) ([btecu](https://github.com/btecu)) | ||
- Add FastBoot tests [\#99](https://github.com/yapplabs/ember-wormhole/pull/99) ([simonihmig](https://github.com/simonihmig)) | ||
- Use "New Module Imports" [\#98](https://github.com/yapplabs/ember-wormhole/pull/98) ([Turbo87](https://github.com/Turbo87)) | ||
- ember-cli 2.14 updates [\#97](https://github.com/yapplabs/ember-wormhole/pull/97) ([Dhaulagiri](https://github.com/Dhaulagiri)) | ||
- Fix wormhole insertion in FastBoot [\#96](https://github.com/yapplabs/ember-wormhole/pull/96) ([sandydoo](https://github.com/sandydoo)) | ||
## [0.5.2](https://github.com/yapplabs/ember-wormhole/tree/0.5.2) (2017-06-12) | ||
[Full Changelog](https://github.com/yapplabs/ember-wormhole/compare/0.5.1...0.5.2) | ||
**Merged pull requests:** | ||
- Fix getDOM for Ember 2.6/2.7 in integration tests [\#95](https://github.com/yapplabs/ember-wormhole/pull/95) ([simonihmig](https://github.com/simonihmig)) | ||
@@ -9,0 +20,0 @@ - Upgrade to Ember-cli 2.13 / Babel6 / yarn [\#94](https://github.com/yapplabs/ember-wormhole/pull/94) ([simonihmig](https://github.com/simonihmig)) |
{ | ||
"name": "ember-wormhole", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "Render a child view somewhere else in the DOM.", | ||
"keywords": [ | ||
"ember-addon" | ||
], | ||
"license": "MIT", | ||
"author": "Yapp Labs", | ||
"directories": { | ||
@@ -9,2 +14,3 @@ "doc": "doc", | ||
}, | ||
"repository": "https://github.com/yapplabs/ember-wormhole.git", | ||
"scripts": { | ||
@@ -15,36 +21,31 @@ "start": "ember server", | ||
}, | ||
"repository": "https://github.com/yapplabs/ember-wormhole.git", | ||
"engines": { | ||
"node": ">= 4" | ||
"dependencies": { | ||
"ember-cli-babel": "^6.8.2", | ||
"ember-cli-htmlbars": "^2.0.1" | ||
}, | ||
"author": "Yapp Labs", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"broccoli-asset-rev": "^2.4.2", | ||
"ember-cli": "^2.13.2", | ||
"ember-cli-app-version": "^1.0.0", | ||
"ember-cli-dependency-checker": "^1.3.0", | ||
"ember-cli-eslint": "^3.0.0", | ||
"ember-cli-github-pages": "0.0.6", | ||
"ember-cli-htmlbars-inline-precompile": "^0.4.0", | ||
"broccoli-asset-rev": "^2.4.5", | ||
"chai": "^4.1.2", | ||
"ember-cli": "~2.16.2", | ||
"ember-cli-dependency-checker": "^2.0.0", | ||
"ember-cli-eslint": "^4.0.0", | ||
"ember-cli-github-pages": "0.1.2", | ||
"ember-cli-htmlbars-inline-precompile": "^1.0.0", | ||
"ember-cli-inject-live-reload": "^1.4.1", | ||
"ember-cli-qunit": "^4.0.0", | ||
"ember-cli-release": "^1.0.0-beta.2", | ||
"ember-cli-shims": "^1.1.0", | ||
"ember-cli-release": "^0.2.9", | ||
"ember-cli-sri": "^2.1.0", | ||
"ember-cli-uglify": "^1.2.0", | ||
"ember-cli-uglify": "^2.0.0", | ||
"ember-code-snippet": "^1.3.0", | ||
"ember-disable-prototype-extensions": "^1.1.0", | ||
"ember-disable-prototype-extensions": "^1.1.2", | ||
"ember-export-application-global": "^2.0.0", | ||
"ember-load-initializers": "^0.5.1", | ||
"ember-fastboot-addon-tests": "^0.4.0", | ||
"ember-load-initializers": "^1.0.0", | ||
"ember-resolver": "^4.0.0", | ||
"ember-source": "~2.13.0", | ||
"ember-source": "~2.16.0", | ||
"loader.js": "^4.2.3" | ||
}, | ||
"keywords": [ | ||
"ember-addon" | ||
], | ||
"dependencies": { | ||
"ember-cli-babel": "^6.0.0", | ||
"ember-cli-htmlbars": "^1.1.1" | ||
"engines": { | ||
"node": "^4.5 || 6.* || >= 7.*" | ||
}, | ||
@@ -51,0 +52,0 @@ "ember-addon": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
292708
17
207
21
+ Addedcaniuse-lite@1.0.30001683(transitive)
+ Addedelectron-to-chromium@1.5.64(transitive)
+ Addedember-cli-htmlbars@2.0.5(transitive)
+ Addedstrip-bom@3.0.0(transitive)
- Removedcaniuse-lite@1.0.30001684(transitive)
- Removedelectron-to-chromium@1.5.65(transitive)
- Removedember-cli-htmlbars@1.3.5(transitive)
- Removedember-cli-version-checker@1.3.1(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedstrip-bom@2.0.0(transitive)
Updatedember-cli-babel@^6.8.2
Updatedember-cli-htmlbars@^2.0.1