mount-observer 0.0.86 → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/preloadContent.js +1 -1
- package/preloadContent.ts +1 -1
- package/upShadowSearch.js +6 -3
- package/upShadowSearch.ts +7 -4
package/package.json
CHANGED
package/preloadContent.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(HTMLTemplateElement.prototype, 'remoteContent', {
|
|
|
9
9
|
if (window[remoteTemplElSym] === undefined) {
|
|
10
10
|
window[remoteTemplElSym] = 0;
|
|
11
11
|
}
|
|
12
|
-
const id = templ.id || window[remoteTemplElSym]
|
|
12
|
+
const id = templ.id || `mount-observer-${window[remoteTemplElSym]++}`;
|
|
13
13
|
const sourceTempl = document.createElement('template');
|
|
14
14
|
sourceTempl.id = '' + id;
|
|
15
15
|
sourceTempl.content.appendChild(templ.content);
|
package/preloadContent.ts
CHANGED
|
@@ -11,7 +11,7 @@ Object.defineProperty(HTMLTemplateElement.prototype, 'remoteContent', {
|
|
|
11
11
|
if((<any>window)[remoteTemplElSym] === undefined ){
|
|
12
12
|
(<any>window)[remoteTemplElSym] = 0;
|
|
13
13
|
}
|
|
14
|
-
const id = templ.id || (<any>window)[remoteTemplElSym]
|
|
14
|
+
const id = templ.id || `mount-observer-${(<any>window)[remoteTemplElSym]++}`;
|
|
15
15
|
const sourceTempl = document.createElement('template');
|
|
16
16
|
sourceTempl.id = '' + id;
|
|
17
17
|
sourceTempl.content.appendChild(templ.content);
|
package/upShadowSearch.js
CHANGED
|
@@ -14,9 +14,12 @@ export function upShadowSearch(ref, id) {
|
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
16
16
|
else if (!rn.isConnected) {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
if (rn.targetFragment) {
|
|
18
|
+
rn = rn.targetFragment;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
rn = document;
|
|
22
|
+
}
|
|
19
23
|
}
|
|
20
|
-
//return null;
|
|
21
24
|
}
|
|
22
25
|
}
|
package/upShadowSearch.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function upShadowSearch(ref: Element, id: string){
|
|
2
|
-
let rn = ref.getRootNode() as
|
|
2
|
+
let rn = ref.getRootNode() as any;
|
|
3
3
|
while(rn){
|
|
4
4
|
let test = rn.getElementById(id);
|
|
5
5
|
if(test) return test;
|
|
@@ -10,11 +10,14 @@ export function upShadowSearch(ref: Element, id: string){
|
|
|
10
10
|
}else if(rn === document){
|
|
11
11
|
return null;
|
|
12
12
|
}else if(!rn.isConnected){
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
if(rn.targetFragment){
|
|
14
|
+
rn = rn.targetFragment;
|
|
15
|
+
}else{
|
|
16
|
+
rn = document;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
|
|
16
20
|
}
|
|
17
|
-
//return null;
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
|