mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
85123: Fix tests #2
This commit is contained in:
@@ -246,6 +246,10 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|||||||
*/
|
*/
|
||||||
private setThemeCss(themeName: string): void {
|
private setThemeCss(themeName: string): void {
|
||||||
const head = this.document.getElementsByTagName('head')[0];
|
const head = this.document.getElementsByTagName('head')[0];
|
||||||
|
if (isEmpty(head)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Array.from to ensure we end up with an array, not an HTMLCollection, which would be
|
// Array.from to ensure we end up with an array, not an HTMLCollection, which would be
|
||||||
// automatically updated if we add nodes later
|
// automatically updated if we add nodes later
|
||||||
const currentThemeLinks = Array.from(head.getElementsByClassName('theme-css'));
|
const currentThemeLinks = Array.from(head.getElementsByClassName('theme-css'));
|
||||||
@@ -272,6 +276,9 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|||||||
|
|
||||||
private setHeadTags(themeName: string): void {
|
private setHeadTags(themeName: string): void {
|
||||||
const head = this.document.getElementsByTagName('head')[0];
|
const head = this.document.getElementsByTagName('head')[0];
|
||||||
|
if (isEmpty(head)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// clear head tags
|
// clear head tags
|
||||||
const currentHeadTags = Array.from(head.getElementsByClassName('theme-head-tag'));
|
const currentHeadTags = Array.from(head.getElementsByClassName('theme-head-tag'));
|
||||||
|
Reference in New Issue
Block a user