-
-
-
-
-
diff --git a/ui-ngx/src/app/shared/components/markdown-editor.component.scss b/ui-ngx/src/app/shared/components/markdown-editor.component.scss
index a4149c54d7..1191c97306 100644
--- a/ui-ngx/src/app/shared/components/markdown-editor.component.scss
+++ b/ui-ngx/src/app/shared/components/markdown-editor.component.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2022 The Thingsboard Authors
+ * Copyright © 2016-2023 The Thingsboard Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -58,20 +58,15 @@
overflow: auto;
height: 100%;
}
- .buttons-panel {
- position: absolute;
- top: 5px;
- right: 24px;
- z-index: 1;
- button.edit-toggle {
- min-width: 32px;
- min-height: 15px;
- padding: 4px;
- margin: 0;
- font-size: .8rem;
- line-height: 15px;
- color: #7b7b7b;
- background: rgba(220, 220, 220, .35);
- }
+ button.panel-button {
+ background: rgba(220, 220, 220, .35);
+ align-items: center;
+ vertical-align: middle;
+ min-width: 32px;
+ min-height: 15px;
+ padding: 4px;
+ font-size: .8rem;
+ line-height: 15px;
+ color: #7b7b7b;
}
}
diff --git a/ui-ngx/src/app/shared/components/markdown-editor.component.ts b/ui-ngx/src/app/shared/components/markdown-editor.component.ts
index 7c1c9c7c02..4747254011 100644
--- a/ui-ngx/src/app/shared/components/markdown-editor.component.ts
+++ b/ui-ngx/src/app/shared/components/markdown-editor.component.ts
@@ -1,5 +1,5 @@
///
-/// Copyright © 2016-2022 The Thingsboard Authors
+/// Copyright © 2016-2023 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
/// limitations under the License.
///
-import { Component, ElementRef, forwardRef, Input, OnInit, ViewChild } from '@angular/core';
+import { Component, ElementRef, forwardRef, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { Ace } from 'ace-builds';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
@@ -32,7 +32,7 @@ import { getAce } from '@shared/models/ace/ace.models';
}
]
})
-export class MarkdownEditorComponent implements OnInit, ControlValueAccessor {
+export class MarkdownEditorComponent implements OnInit, ControlValueAccessor, OnDestroy {
@Input() label: string;
@@ -40,6 +40,8 @@ export class MarkdownEditorComponent implements OnInit, ControlValueAccessor {
@Input() readonly: boolean;
+ @Input() helpId: string;
+
@ViewChild('markdownEditor', {static: true})
markdownEditorElmRef: ElementRef;
@@ -104,6 +106,12 @@ export class MarkdownEditorComponent implements OnInit, ControlValueAccessor {
}
}
+ ngOnDestroy(): void {
+ if (this.markdownEditor) {
+ this.markdownEditor.destroy();
+ }
+ }
+
registerOnChange(fn: any): void {
this.propagateChange = fn;
}
diff --git a/ui-ngx/src/app/shared/components/markdown.component.html b/ui-ngx/src/app/shared/components/markdown.component.html
index 1b1eb7b8f9..5b8b9f8af0 100644
--- a/ui-ngx/src/app/shared/components/markdown.component.html
+++ b/ui-ngx/src/app/shared/components/markdown.component.html
@@ -1,6 +1,6 @@
-