Toggle preview

This commit is contained in:
Mel O'Hagan 2023-11-03 14:08:46 +00:00
parent f02f5576f4
commit a03a00c4af
1 changed files with 3 additions and 1 deletions

View File

@ -20,7 +20,9 @@
// control
$: checkValue(value)
$: mde?.codemirror.on("change", debouncedUpdate)
$: mde?.codemirror.setOption("readOnly", readonly)
$: if (readonly || disabled) {
mde?.togglePreview()
}
const checkValue = val => {
if (mde && val !== latestValue) {