From 44d4e01fc7df3641ea516e3738f50bd3833e0e11 Mon Sep 17 00:00:00 2001 From: HasnatL-Adapptlimited Date: Thu, 17 Apr 2025 01:42:36 +0100 Subject: [PATCH 1/2] Overlap text fix + Retain colour of text on paste --- .../html-widget-content.component.ts | 25 +++++++++++++++++-- libs/shared/src/lib/const/tinymce.const.ts | 2 ++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/libs/shared/src/lib/components/widgets/common/html-widget-content/html-widget-content.component.ts b/libs/shared/src/lib/components/widgets/common/html-widget-content/html-widget-content.component.ts index 90150cd4f5..9a7859c6c0 100644 --- a/libs/shared/src/lib/components/widgets/common/html-widget-content/html-widget-content.component.ts +++ b/libs/shared/src/lib/components/widgets/common/html-widget-content/html-widget-content.component.ts @@ -1,4 +1,4 @@ -import { Component, ElementRef, Input } from '@angular/core'; +import { AfterViewInit, Component, ElementRef, Input } from '@angular/core'; import { SafeHtml } from '@angular/platform-browser'; /** @@ -13,7 +13,7 @@ import { SafeHtml } from '@angular/platform-browser'; // todo: enable // encapsulation: ViewEncapsulation.ShadowDom, }) -export class HtmlWidgetContentComponent { +export class HtmlWidgetContentComponent implements AfterViewInit { /** * HTML to render */ @@ -29,4 +29,25 @@ export class HtmlWidgetContentComponent { * @param {ElementRef} el Element reference */ constructor(public el: ElementRef) {} + + /** + * Script to fix bulletin and announcement text overlapping issue + */ + ngAfterViewInit(): void { + // Find the element with the class "text-overlapping-fix" + const overlappedElement: HTMLElement | null = + this.el.nativeElement.querySelector('.text-overlapping-fix'); + + // If the element exists, remove all inline styles from its children + if (overlappedElement) { + // Find all elements with the "style" attribute + const elementsWithStyle: NodeListOf = + overlappedElement.querySelectorAll('[style]'); + + // Iterate over the elements and remove the "style" attribute + elementsWithStyle.forEach((element: HTMLElement) => { + element.removeAttribute('style'); + }); + } + } } diff --git a/libs/shared/src/lib/const/tinymce.const.ts b/libs/shared/src/lib/const/tinymce.const.ts index b2ba88dc92..bba71afdec 100644 --- a/libs/shared/src/lib/const/tinymce.const.ts +++ b/libs/shared/src/lib/const/tinymce.const.ts @@ -337,6 +337,8 @@ export const FIELD_EDITOR_CONFIG: RawEditorSettings = { menubar: 'edit view insert format tools table help', toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | charmap emoticons | fullscreen preview save | insertfile image media link avatar recordeditor', + paste_retain_style_properties: 'color font-size', + paste_webkit_styles: 'color font-size', toolbar_sticky: true, image_advtab: true, importcss_append: true, From 31035e65e0a11db9148b97353009a9fe759f1b53 Mon Sep 17 00:00:00 2001 From: Antoine Hurard Date: Wed, 23 Apr 2025 11:10:17 +0200 Subject: [PATCH 2/2] merge next --- libs/shared/src/lib/const/tinymce.const.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/libs/shared/src/lib/const/tinymce.const.ts b/libs/shared/src/lib/const/tinymce.const.ts index a075b1f9ba..e2f9357e5b 100644 --- a/libs/shared/src/lib/const/tinymce.const.ts +++ b/libs/shared/src/lib/const/tinymce.const.ts @@ -337,8 +337,6 @@ export const FIELD_EDITOR_CONFIG: RawEditorSettings = { menubar: 'edit view insert format tools table help', toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | charmap emoticons | fullscreen preview save | insertfile image media link avatar recordeditor', - paste_retain_style_properties: 'color font-size', - paste_webkit_styles: 'color font-size', toolbar_sticky: true, paste_retain_style_properties: 'color font-size', paste_webkit_styles: 'color font-size',