Skip to content

Commit

Permalink
Merge align-text-attribute into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
stage-branch-merger[bot] authored Nov 14, 2024
2 parents 715b9ec + 39a14a1 commit af07ca6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/app/page/component/content-text/content-text.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ export class ContentTextComponent implements OnChanges {
}

private init(): void {
const styles = {};
this.text?.textStyles?.forEach((style) => {
if (style.name === 'BOLD') styles['font-weight'] = 'bold';
if (style.name === 'ITALIC') styles['font-style'] = 'italic';
if (style.name === 'UNDERLINE') styles['text-decoration'] = 'underline';
});
const styles = {
'font-weight': this.text.textStyles.some(style => style.name === 'BOLD') ? 'bold' : '',
'font-style': this.text.textStyles.some(style => style.name === 'ITALIC') ? 'italic' : '',
'text-decoration': this.text.textStyles.some(style => style.name === 'UNDERLINE') ? 'underline' : '',
'text-align': this.text.textAlign.name || '',
'color': this.text.textColor || ''
};

this.textColor = this.text?.textColor || null;
this.styles = styles;
this.textColor = this.text.textColor || null;
const text = parseTextAddBrTags(this.text.text);
this.textValue = text || '';
this.ready = true;
Expand Down

0 comments on commit af07ca6

Please sign in to comment.