aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-02-23 11:38:15 -0500
committerBob Zeleznik <zzzman@gmail.com>2019-02-23 11:38:15 -0500
commitd9d55e422826da1fe87aa7973c92e54bc0c99f02 (patch)
treea76879eae19b3f207a1b34ce6ed9a5c987aabd4f /src
parent91266fe499ef42d37764858906db9b7d15607d3f (diff)
working overlays
Diffstat (limited to 'src')
-rw-r--r--src/client/documents/Documents.ts14
-rw-r--r--src/client/views/collections/CollectionFreeFormView.scss9
-rw-r--r--src/client/views/collections/CollectionFreeFormView.tsx6
-rw-r--r--src/client/views/nodes/FormattedTextBox.scss2
4 files changed, 20 insertions, 11 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 72efb45f5..4c5f26fbd 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -127,18 +127,18 @@ export namespace Documents {
}
// example of custom display string for an image that shows a caption.
- function CaptionLayoutString() {
+ function EmbeddedCaption() {
return `<div style="position:absolute; height:100%">
<div style="position:relative; margin:auto; width:85%; margin:auto" >`
+ 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 OverlayLayoutString() {
- return `<div style="position:absolute; height:100%; width:100%">
- <div style="position:absolute; max-height:10%; width:100%; min-height:10%; overflow:scroll;text-align:center;bottom:0;">`
+ 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>` };
@@ -148,8 +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.OverlayLayout, new TextField(OverlayLayoutString()));
+ 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" });
diff --git a/src/client/views/collections/CollectionFreeFormView.scss b/src/client/views/collections/CollectionFreeFormView.scss
index 6d678528a..e682b9815 100644
--- a/src/client/views/collections/CollectionFreeFormView.scss
+++ b/src/client/views/collections/CollectionFreeFormView.scss
@@ -1,4 +1,13 @@
.collectionfreeformview-container {
+
+ ::-webkit-scrollbar {
+ -webkit-appearance: none;
+ width: 10px;
+ }
+ ::-webkit-scrollbar-thumb {
+ border-radius: 5px;
+ background-color: rgba(0,0,0,.5);
+ }
border-style: solid;
box-sizing: border-box;
position: relative;
diff --git a/src/client/views/collections/CollectionFreeFormView.tsx b/src/client/views/collections/CollectionFreeFormView.tsx
index 85f7d5677..cb6668634 100644
--- a/src/client/views/collections/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/CollectionFreeFormView.tsx
@@ -120,8 +120,8 @@ export class CollectionFreeFormView extends CollectionViewBase {
private SetPan(panX: number, panY: number) {
const newPanX = Math.max((1 - this.zoomScaling) * this.nativeWidth, Math.min(0, panX));
const newPanY = Math.max((1 - this.zoomScaling) * this.nativeHeight, Math.min(0, panY));
- this.props.Document.SetNumber(KeyStore.PanX, this.isAnnotationOverlay ? newPanX : panX);
- this.props.Document.SetNumber(KeyStore.PanY, this.isAnnotationOverlay ? newPanY : panY);
+ this.props.Document.SetNumber(KeyStore.PanX, false && this.isAnnotationOverlay ? newPanX : panX);
+ this.props.Document.SetNumber(KeyStore.PanY, false && this.isAnnotationOverlay ? newPanY : panY);
}
@action
@@ -238,7 +238,7 @@ export class CollectionFreeFormView extends CollectionViewBase {
{this.backgroundView}
{this.views}
</div>
- {overlay}
+ {this.overlayView}
</div>
);
}
diff --git a/src/client/views/nodes/FormattedTextBox.scss b/src/client/views/nodes/FormattedTextBox.scss
index 872a2138b..226456fab 100644
--- a/src/client/views/nodes/FormattedTextBox.scss
+++ b/src/client/views/nodes/FormattedTextBox.scss
@@ -10,5 +10,5 @@
.formattedTextBox-cont {
background: beige;
- padding: 1vw;
+ padding: 0;
} \ No newline at end of file