MOBILE-2567 core: Fix descriptions not shortened in dashboard

main
Dani Palou 2018-08-28 13:45:28 +02:00
parent b72cea5823
commit c4f779b1d5
1 changed files with 8 additions and 5 deletions

View File

@ -272,6 +272,14 @@ export class CoreFormatTextDirective implements OnChanges {
return;
}
// In AOT the inputs and ng-reflect aren't in the DOM sometimes. Add them so styles are applied.
if (this.maxHeight && !this.element.getAttribute('maxHeight')) {
this.element.setAttribute('maxHeight', String(this.maxHeight));
}
if (!this.element.getAttribute('singleLine')) {
this.element.setAttribute('singleLine', String(this.utils.isTrueOrOne(this.singleLine)));
}
this.text = this.text ? this.text.trim() : '';
this.formatContents().then((div: HTMLElement) => {
@ -281,11 +289,6 @@ export class CoreFormatTextDirective implements OnChanges {
this.element.innerHTML = ''; // Remove current contents.
if (this.maxHeight && div.innerHTML != '') {
// For some reason, in iOS the inputs and ng-reflect aren't in the DOM sometimes. Add it so styles are applied.
if (!this.element.getAttribute('maxHeight')) {
this.element.setAttribute('maxHeight', String(this.maxHeight));
}
// Move the children to the current element to be able to calculate the height.
this.domUtils.moveChildren(div, this.element);