diff options
author | bobzel <zzzman@gmail.com> | 2022-10-04 16:53:24 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-10-04 16:53:24 -0400 |
commit | bb9ddc6aaf5860736b0bd07333a33876b0c1d7ef (patch) | |
tree | 35ec2a69d9d5d4f45d9e3ed21acb72527365c035 /src/fields/Doc.ts | |
parent | 995ed33feef1eb663d65b1b1d3da8c91926013dc (diff) | |
parent | 6e22c212e288eb3e69740a78732f81485c97a577 (diff) |
Merge branch 'master' into pres-pin-fixes
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index a3c742f28..0ceaff968 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -33,7 +33,10 @@ export namespace Field { return !Field.IsField(field) ? '' : (onDelegate ? '=' : '') + (field instanceof ComputedField ? `:=${field.script.originalScript}` : Field.toScriptString(field)); } export function toScriptString(field: Field): string { - if (typeof field === 'string') return `"${field}"`; + if (typeof field === 'string') { + if (field.startsWith('{"')) return `'${field}'`; // bcz: hack ... want to quote the string the right way. if there are nested "'s, then use ' instead of ". In this case, test for the start of a JSON string of the format {"property": ... } and use outer 's instead of "s + return `"${field}"`; + } if (typeof field === 'number' || typeof field === 'boolean') return String(field); if (field === undefined || field === null) return 'null'; return field[ToScriptString](); @@ -1399,11 +1402,17 @@ export namespace Doc { layoutDoc._viewScale = NumCast(layoutDoc._viewScale, 1) * contentScale; layoutDoc._nativeWidth = undefined; layoutDoc._nativeHeight = undefined; + layoutDoc._forceReflow = undefined; + layoutDoc._nativeHeightUnfrozen = undefined; + layoutDoc._nativeDimModifiable = undefined; } else { layoutDoc._autoHeight = false; if (!Doc.NativeWidth(layoutDoc)) { layoutDoc._nativeWidth = NumCast(layoutDoc._width, panelWidth); layoutDoc._nativeHeight = NumCast(layoutDoc._height, panelHeight); + layoutDoc._forceReflow = true; + layoutDoc._nativeHeightUnfrozen = true; + layoutDoc._nativeDimModifiable = true; } } }); |