-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for insertBefore API change as per RFC287
* enforces `insertBefore=null` as only allowed value * Adds implementation for default replace semantics *This is a breaking change!*
- Loading branch information
1 parent
a7fef5f
commit d79504e
Showing
6 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Component from '@ember/component'; | ||
import layout from '../templates/components/-in-element-replace'; | ||
|
||
export default Component.extend({ | ||
layout, | ||
tagName: '', | ||
|
||
init() { | ||
this._super(...arguments); | ||
this._marker = self.document ? self.document.createTextNode('') : ''; | ||
}, | ||
|
||
didInsertElement() { | ||
let element = this.get('node'); | ||
while (element.firstChild && element.firstChild !== this._marker) { | ||
element.removeChild(element.firstChild); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{! template-lint-disable no-unbound }} | ||
{{#-in-element this.node}}{{unbound this._marker}}{{yield}}{{/-in-element}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-in-element-polyfill/components/-in-element-replace'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters