diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-05-08 00:45:14 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-05-08 00:45:14 -0400 |
commit | d588a4543f1ccc06d1e45fe748007b730c18c042 (patch) | |
tree | 94991fa0166242205bcfe0cb3d251634a348352f /src/client/views/nodes/DocumentContentsView.tsx | |
parent | 26141a697ae52a7edf3cc6845ce2153111f8860e (diff) |
small fixes to titles, templates, minimizing, and keyvalue deletion
Diffstat (limited to 'src/client/views/nodes/DocumentContentsView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentContentsView.tsx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/client/views/nodes/DocumentContentsView.tsx b/src/client/views/nodes/DocumentContentsView.tsx index bbc927b5a..1dc6343e8 100644 --- a/src/client/views/nodes/DocumentContentsView.tsx +++ b/src/client/views/nodes/DocumentContentsView.tsx @@ -64,10 +64,16 @@ export class DocumentContentsView extends React.Component<DocumentViewProps & { let base = baseLayout; let layout = baseLayout; - this.templates.forEach(template => { - layout = template.replace("{layout}", base); - base = layout; - }); + // bcz: templates are intended for the main document layout. However, + // a DocumentContentsView is also used to render the annotation overlay for a document. + // So we detect that here by checking the layoutKey. This should probably be moved into + // a prop so that the overlay can explicitly turn off templates. + if (this.props.layoutKey !== "backgroundLayout") { + this.templates.forEach(template => { + layout = template.replace("{layout}", base); + base = layout; + }); + } return layout; } |