-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
48 additions
and
43 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export async function getHostish(el) { | ||
let { localName, ish } = el; | ||
if (localName.includes('-')) { | ||
await customElements.whenDefined(localName); | ||
return el; | ||
} | ||
if (ish instanceof HTMLElement) | ||
return ish; | ||
const itemScopeAttr = el.getAttribute('itemscope'); | ||
if (itemScopeAttr) { | ||
//let ish = (<any>el).ish as HTMLElement | undefined; | ||
//if(host) return getHostish(host, prop); | ||
const { Newish, waitForEvent } = await import('./Newish.js'); | ||
const ah = new Newish(el, itemScopeAttr); | ||
if (!ah.isResolved) { | ||
await waitForEvent(ah, 'resolved'); | ||
} | ||
ish = el.ish; | ||
return ish; | ||
} | ||
} |
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,21 @@ | ||
export async function getHostish(el: Element){ | ||
let {localName, ish} = el as any; | ||
if(localName.includes('-')){ | ||
await customElements.whenDefined(localName); | ||
return el; | ||
} | ||
if(ish instanceof HTMLElement) return ish; | ||
const itemScopeAttr = el.getAttribute('itemscope'); | ||
if(itemScopeAttr){ | ||
//let ish = (<any>el).ish as HTMLElement | undefined; | ||
//if(host) return getHostish(host, prop); | ||
const {Newish, waitForEvent} = await import('./Newish.js'); | ||
const ah = new Newish(el, itemScopeAttr); | ||
if(!ah.isResolved){ | ||
await waitForEvent(ah, 'resolved'); | ||
} | ||
ish = (<any>el).ish as HTMLElement | undefined; | ||
return ish; | ||
|
||
} | ||
} |
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