@veloceapps/sdk 8.0.0-171 → 8.0.0-173
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/cms/services/resources.service.d.ts +2 -0
- package/esm2020/cms/services/resources.service.mjs +10 -6
- package/fesm2015/veloceapps-sdk-cms.mjs +8 -4
- package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-cms.mjs +8 -4
- package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1558,9 +1558,13 @@ class ResourcesService {
|
|
|
1558
1558
|
}
|
|
1559
1559
|
return this.loaded$.pipe(filter(() => this.scripts.get(url) === true), take(1));
|
|
1560
1560
|
}
|
|
1561
|
-
loadStyles(
|
|
1562
|
-
const
|
|
1563
|
-
const
|
|
1561
|
+
loadStyles(first, second) {
|
|
1562
|
+
const url = typeof first === 'string' ? first : typeof second === 'string' ? second : '';
|
|
1563
|
+
const host = typeof first !== 'string' ? first : null;
|
|
1564
|
+
let el = host?.injector.get(ElementRef)?.nativeElement ?? document.body;
|
|
1565
|
+
while (el.parentNode) {
|
|
1566
|
+
el = el.parentNode;
|
|
1567
|
+
}
|
|
1564
1568
|
return new Observable(subscriber => {
|
|
1565
1569
|
const link = document.createElement('link');
|
|
1566
1570
|
link.rel = 'stylesheet';
|
|
@@ -1571,7 +1575,7 @@ class ResourcesService {
|
|
|
1571
1575
|
subscriber.next();
|
|
1572
1576
|
subscriber.complete();
|
|
1573
1577
|
};
|
|
1574
|
-
|
|
1578
|
+
el.appendChild(link);
|
|
1575
1579
|
});
|
|
1576
1580
|
}
|
|
1577
1581
|
persistAMDLoader() {
|