aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-02-25 11:25:44 -0500
committerTyler Schicke <tyler_schicke@brown.edu>2019-02-25 11:25:44 -0500
commit2ab7ee87a2f22d029c1cf25a8f776cb3f17a24b3 (patch)
treeee6c0989cff19f539ca7a34a5b9d09489de21613 /src/client/documents/Documents.ts
parentcb56876b21dc47f26747f902bd81df49eae4cf4b (diff)
parente57c8ed3944bf737afdb2f564d159a53f8a6b1c6 (diff)
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index d8e1db0b0..2dfff6235 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -127,12 +127,18 @@ export namespace Documents {
}
// example of custom display string for an image that shows a caption.
- function CaptionLayoutString() {
- return `<div style="position:absolute; height:100%">
- <div style="position:relative; margin:auto; width:85%; margin:auto" >`
+ function EmbeddedCaption() {
+ return `<div style="height:100%">
+ <div style="position:relative; margin:auto; height:85%;" >`
+ ImageBox.LayoutString() +
`</div>
- <div style="position:relative; min-height:15%; overflow:scroll; max-height:15%; text-align:center; ">`
+ <div style="position:relative; overflow:auto; height:15%; text-align:center; ">`
+ + FormattedTextBox.LayoutString("CaptionKey") +
+ `</div>
+ </div>` };
+ function FixedCaption() {
+ return `<div style="position:absolute; height:30px; bottom:0; width:100%">
+ <div style="position:absolute; width:100%; height:100%; overflow:auto;text-align:center;bottom:0;">`
+ FormattedTextBox.LayoutString("CaptionKey") +
`</div>
</div>` };
@@ -142,7 +148,8 @@ export namespace Documents {
setupOptions(doc, options);
doc.Set(KeyStore.Data, new ImageField(new URL(url)));
doc.Set(KeyStore.Caption, new TextField("my caption..."));
- doc.Set(KeyStore.BackgroundLayout, new TextField(CaptionLayoutString()));
+ doc.Set(KeyStore.BackgroundLayout, new TextField(EmbeddedCaption()));
+ doc.Set(KeyStore.OverlayLayout, new TextField(FixedCaption()));
doc.Set(KeyStore.LayoutKeys, new ListField([KeyStore.Data, KeyStore.Annotations, KeyStore.Caption]));
let annotation = Documents.TextDocument({ title: "hello" });