export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit {
@Input() content = ''
- @Input() classes: string[] | { [klass: string]: any[] | any } = []
-
- @Input() textareaMaxWidth = '100%'
- @Input() textareaHeight = '150px'
+ @Input() formError: string
@Input() truncate: number
previewHTML: SafeHtml | string = ''
isMaximized = false
+ disabled = false
maximizeInText = $localize`Maximize editor`
maximizeOutText = $localize`Exit maximized editor`
}
onMaximizeClick () {
+ if (this.disabled) return
+
this.isMaximized = !this.isMaximized
// Make sure textarea have the focus
}
}
+ setDisabledState (isDisabled: boolean) {
+ this.disabled = isDisabled
+ }
+
private lockBodyScroll () {
this.scrollPosition = this.viewportScroller.getScrollPosition()
document.getElementById('content').classList.add('lock-scroll')
const result = await this.customMarkdownRenderer(text)
if (result instanceof HTMLElement) {
- html = ''
-
const wrapperElement = this.previewElement.nativeElement as HTMLElement
wrapperElement.innerHTML = ''
wrapperElement.appendChild(result)