MOBILE-4653 core: Deprecate unused hideIfEmpty on format-text
parent
09a2cd2cef
commit
6747d154d9
|
@ -92,20 +92,25 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec
|
||||||
@Input({ transform: toBoolean }) wsNotFiltered = false; // If true it means the WS didn't filter the text for some reason.
|
@Input({ transform: toBoolean }) wsNotFiltered = false; // If true it means the WS didn't filter the text for some reason.
|
||||||
@Input({ transform: toBoolean }) captureLinks = true; // Whether links should tried to be opened inside the app.
|
@Input({ transform: toBoolean }) captureLinks = true; // Whether links should tried to be opened inside the app.
|
||||||
@Input({ transform: toBoolean }) openLinksInApp = false; // Whether links should be opened in InAppBrowser.
|
@Input({ transform: toBoolean }) openLinksInApp = false; // Whether links should be opened in InAppBrowser.
|
||||||
@Input({ transform: toBoolean }) hideIfEmpty = false; // If true, the tag will contain nothing if text is empty.
|
|
||||||
@Input({ transform: toBoolean }) disabled = false; // If disabled, autoplay elements will be disabled.
|
@Input({ transform: toBoolean }) disabled = false; // If disabled, autoplay elements will be disabled.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated since 5.0. Not used anymore.
|
||||||
|
*/
|
||||||
|
@Input() hideIfEmpty = false; // If true, the tag will contain nothing if text is empty.
|
||||||
|
|
||||||
@Output() afterRender = new EventEmitter<void>(); // Called when the data is rendered.
|
@Output() afterRender = new EventEmitter<void>(); // Called when the data is rendered.
|
||||||
@Output() filterContentRenderingComplete = new EventEmitter<void>(); // Called when the filters have finished rendering content.
|
@Output() filterContentRenderingComplete = new EventEmitter<void>(); // Called when the filters have finished rendering content.
|
||||||
@Output() onClick: EventEmitter<void> = new EventEmitter(); // Called when clicked.
|
@Output() onClick: EventEmitter<void> = new EventEmitter(); // Called when clicked.
|
||||||
|
|
||||||
protected element: HTMLElement;
|
protected element: HTMLElement;
|
||||||
protected elementControllers: ElementController[] = [];
|
protected elementControllers: ElementController[] = [];
|
||||||
protected emptyText = '';
|
|
||||||
protected domPromises: CoreCancellablePromise<void>[] = [];
|
protected domPromises: CoreCancellablePromise<void>[] = [];
|
||||||
protected domElementPromise?: CoreCancellablePromise<void>;
|
protected domElementPromise?: CoreCancellablePromise<void>;
|
||||||
protected externalContentInstances: CoreExternalContentDirective[] = [];
|
protected externalContentInstances: CoreExternalContentDirective[] = [];
|
||||||
|
|
||||||
|
protected static readonly EMPTY_TEXT = ' ';
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
element: ElementRef,
|
element: ElementRef,
|
||||||
protected viewContainerRef: ViewContainerRef,
|
protected viewContainerRef: ViewContainerRef,
|
||||||
|
@ -116,8 +121,7 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec
|
||||||
this.element = element.nativeElement;
|
this.element = element.nativeElement;
|
||||||
this.element.classList.add('core-loading'); // Hide contents until they're treated.
|
this.element.classList.add('core-loading'); // Hide contents until they're treated.
|
||||||
|
|
||||||
this.emptyText = this.hideIfEmpty ? '' : ' ';
|
this.element.innerHTML = CoreFormatTextDirective.EMPTY_TEXT;
|
||||||
this.element.innerHTML = this.emptyText;
|
|
||||||
|
|
||||||
this.element.addEventListener('click', (event) => this.elementClicked(event));
|
this.element.addEventListener('click', (event) => this.elementClicked(event));
|
||||||
}
|
}
|
||||||
|
@ -365,7 +369,7 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec
|
||||||
this.externalContentInstances = [];
|
this.externalContentInstances = [];
|
||||||
|
|
||||||
if (!this.text) {
|
if (!this.text) {
|
||||||
this.element.innerHTML = this.emptyText; // Remove current contents.
|
this.element.innerHTML = CoreFormatTextDirective.EMPTY_TEXT; // Remove current contents.
|
||||||
|
|
||||||
await this.finishRender();
|
await this.finishRender();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue