From 0b85eecdb974a7446be855f7b2fdef8978b65733 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Thu, 12 Mar 2020 20:29:06 -0400 Subject: cleaned up presentationBox code and buttons in view chromes. --- src/client/views/presentationview/PresElementBox.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/client/views/presentationview/PresElementBox.tsx') diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx index 8d62c34c5..9329a5aa1 100644 --- a/src/client/views/presentationview/PresElementBox.tsx +++ b/src/client/views/presentationview/PresElementBox.tsx @@ -28,14 +28,13 @@ library.add(faArrowDown); export const presSchema = createSchema({ presentationTargetDoc: Doc, presBox: Doc, - presBoxKey: "string", - showButton: "boolean", + zoomButton: "boolean", navButton: "boolean", hideTillShownButton: "boolean", fadeButton: "boolean", hideAfterButton: "boolean", groupButton: "boolean", - embedOpen: "boolean" + expandInlineButton: "boolean" }); type PresDocument = makeInterface<[typeof presSchema, typeof documentSchema]>; @@ -57,7 +56,7 @@ export class PresElementBox extends DocExtendableComponent [this.presElementDoc.embedOpen, this.presElementDoc.collapsedHeight], + this._heightDisposer = reaction(() => [this.presElementDoc.expandInlineButton, this.presElementDoc.collapsedHeight], params => this.presLayoutDoc._height = NumCast(params[1]) + (Number(params[0]) ? 100 : 0), { fireImmediately: true }); } componentWillUnmount() { @@ -133,7 +132,7 @@ export class PresElementBox extends DocExtendableComponent { e.stopPropagation(); - this.presElementDoc.showButton = !this.presElementDoc.showButton; - if (!this.presElementDoc.showButton) { + this.presElementDoc.zoomButton = !this.presElementDoc.zoomButton; + if (!this.presElementDoc.zoomButton) { this.presElementDoc.viewScale = 1; } else { this.presElementDoc.navButton = false; @@ -169,7 +168,7 @@ export class PresElementBox extends DocExtendableComponent { - return !this.presElementDoc.embedOpen || !this.targetDoc ? (null) : + return !this.presElementDoc.expandInlineButton || !this.targetDoc ? (null) :
e.stopPropagation()} onClick={e => this.props.removeDocument && this.props.removeDocument(this.presElementDoc)}>X
} - + - +
{this.renderEmbeddedInline()} -- cgit v1.2.3-70-g09d2