diff options
author | bob <bcz@cs.brown.edu> | 2019-05-16 12:28:31 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-05-16 12:28:31 -0400 |
commit | 25e5aa78f858e35eb0f8e7b49d528bdac6691513 (patch) | |
tree | 721079a03ef823b9bc371c0feba7b54697a2fc52 /src | |
parent | 5c7926ebe144644814043c43c0cdc2cf8866e4cd (diff) |
fixed MakeAlias to check if doc is prototype. fixed summary template to bottom/right + capture image when zoomed, fixed full screen to copy view data on delegate
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/Templates.tsx | 2 | ||||
-rw-r--r-- | src/client/views/collections/collectionFreeForm/MarqueeView.tsx | 2 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 2 | ||||
-rw-r--r-- | src/new_fields/Doc.ts | 5 |
4 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/Templates.tsx b/src/client/views/Templates.tsx index 8d6bfbefd..5d29e68ae 100644 --- a/src/client/views/Templates.tsx +++ b/src/client/views/Templates.tsx @@ -74,7 +74,7 @@ export namespace Templates { export function ImageOverlay(width: number, height: number, field: string = "thumbnail") { return (`<div> <div style="height:100%; width:100%; position:absolute;">{layout}</div> - <div style="height:${height}px; top:0; right:0; background:rgba(0,0,0,0.25); position:absolute;overflow:hidden;"> + <div style="height:${height}px; bottom:0; right:0; background:rgba(0,0,0,0.25); position:absolute;overflow:hidden;"> <ImageBox id="isExpander" {...props} PanelWidth={${width}} fieldKey={"${field}"} /> </div> </div>`); diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx index 17d0a533e..12edb2c2a 100644 --- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx +++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx @@ -257,7 +257,7 @@ export class MarqueeView extends React.Component<MarqueeViewProps> if (e.key === "s" || e.key === "p") { - htmlToImage.toPng(this._mainCont.current!, { width: bounds.width, height: bounds.height, quality: 1 }).then((dataUrl) => { + htmlToImage.toPng(this._mainCont.current!, { width: bounds.width * zoomBasis, height: bounds.height * zoomBasis, quality: 1 }).then((dataUrl) => { selected.map(d => { this.props.removeDocument(d); d.x = NumCast(d.x) - bounds.left - bounds.width / 2; diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 260630216..cf8bcbb42 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -227,7 +227,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu } } fullScreenClicked = (e: React.MouseEvent): void => { - const doc = Doc.MakeDelegate(FieldValue(this.Document.proto)); + const doc = Doc.MakeCopy(this.props.Document, false); if (doc) { CollectionDockingView.Instance.OpenFullScreen(doc); } diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 2ae816da4..de72be3ea 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -140,7 +140,7 @@ export namespace Doc { return Cast(Get(doc, key, ignoreProto), ctor) as FieldResult<T>; } export async function SetOnPrototype(doc: Doc, key: string, value: Field) { - const proto = Object.getOwnPropertyNames(doc).indexOf("isPrototype") == -1 ? doc.proto : doc; + const proto = Object.getOwnPropertyNames(doc).indexOf("isPrototype") === -1 ? doc.proto : doc; if (proto) { proto[key] = value; @@ -178,9 +178,10 @@ export namespace Doc { } export function MakeAlias(doc: Doc) { + const proto = Object.getOwnPropertyNames(doc).indexOf("isPrototype") === -1 ? doc.proto : undefined; const alias = new Doc; - if (!doc.proto) { + if (!proto) { alias.proto = doc; } else { PromiseValue(Cast(doc.proto, Doc)).then(proto => { |