Merge pull request #4957 from GabrielInTheWorld/hotfixPreview

Hotfix for preview on firefox
This commit is contained in:
Emanuel Schütze 2019-08-28 12:18:27 +02:00 committed by GitHub
commit 210cf4bf32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
import { Component, Input } from '@angular/core'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { SearchProperty } from 'app/core/ui-services/search.service'; import { SearchProperty } from 'app/core/ui-services/search.service';
@ -8,7 +8,8 @@ import { Searchable } from 'app/site/base/searchable';
@Component({ @Component({
selector: 'os-preview', selector: 'os-preview',
templateUrl: './preview.component.html', templateUrl: './preview.component.html',
styleUrls: ['./preview.component.scss'] styleUrls: ['./preview.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
}) })
export class PreviewComponent { export class PreviewComponent {
/** /**
@ -23,6 +24,7 @@ export class PreviewComponent {
const representation = model.formatForSearch(); const representation = model.formatForSearch();
this.formattedSearchValue = representation.properties; this.formattedSearchValue = representation.properties;
this.modelType = representation.type; this.modelType = representation.type;
this.cd.detectChanges();
} }
} }
@ -46,7 +48,7 @@ export class PreviewComponent {
* *
* @param sanitizer DomSanitizer * @param sanitizer DomSanitizer
*/ */
public constructor(private sanitizer: DomSanitizer) {} public constructor(private sanitizer: DomSanitizer, private cd: ChangeDetectorRef) {}
/** /**
* Function to sanitize any text to show html. * Function to sanitize any text to show html.