From 35d5458347a10b9af9bcf65e5fddbb92d842c8b1 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 1 Sep 2022 16:26:01 -0400 Subject: cleanup preselementbox a little. --- src/client/views/nodes/trails/PresElementBox.tsx | 129 ++++++----------------- 1 file changed, 35 insertions(+), 94 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/trails/PresElementBox.tsx b/src/client/views/nodes/trails/PresElementBox.tsx index a00441ddc..e4fab7528 100644 --- a/src/client/views/nodes/trails/PresElementBox.tsx +++ b/src/client/views/nodes/trails/PresElementBox.tsx @@ -81,9 +81,7 @@ export class PresElementBox extends ViewBoxBaseComponent() { ScreenToLocalListTransform = (xCord: number, yCord: number) => [xCord, yCord]; @action - presExpandDocumentClick = () => { - this.rootDoc.presExpandInlineButton = !this.rootDoc.presExpandInlineButton; - }; + presExpandDocumentClick = () => (this.rootDoc.presExpandInlineButton = !this.rootDoc.presExpandInlineButton); embedHeight = (): number => 97; // embedWidth = () => this.props.PanelWidth(); @@ -385,7 +383,6 @@ export class PresElementBox extends ViewBoxBaseComponent() { hideRecording = (e: React.MouseEvent, iconClick: boolean = false) => { e.stopPropagation(); this.removeAllRecordingInOverlay(); - // if (iconClick) PresElementBox.showVideo = false; }; @@ -405,7 +402,8 @@ export class PresElementBox extends ViewBoxBaseComponent() { @undoBatch @action - startRecording = (activeItem: Doc) => { + startRecording = (e: React.MouseEvent, activeItem: Doc) => { + e.stopPropagation(); console.log('start recording', 'activeItem', activeItem); if (PresElementBox.videoIsRecorded(activeItem)) { // if we already have an existing recording @@ -481,22 +479,13 @@ export class PresElementBox extends ViewBoxBaseComponent() { onPointerOver={this.onPointerOver} onPointerLeave={this.onPointerLeave} onPointerDown={this.headerDown}> - {/* {miniView ? - // when width is LESS than 110 px -
- {`${this.indexInPres + 1}.`} -
- : - // when width is MORE than 110 px -
- {`${this.indexInPres + 1}.`} -
} */} - {/*
- {`${this.indexInPres + 1}.`} -
*/} - {miniView ? null : ( + {miniView ? ( +
+ {`${this.indexInPres + 1}.`} +
+ ) : (
() {
{/*
{"Movement speed"}
}>
{this.transition}
*/} {/*
{"Duration"}
}>
{this.duration}
*/} -
- -
{'Update view'}
- - }> +
+ Update view
}>
this.updateView(targetDoc, activeItem)} style={{ fontWeight: 700, display: activeItem.presPinView ? 'flex' : 'none' }}> V
- - {this.recordingIsInOverlay ? ( - -
{'Hide Recording'}
- - }> -
this.hideRecording(e, true)} style={{ fontWeight: 700 }}> - e.stopPropagation()} /> -
-
- ) : ( - -
{`${PresElementBox.videoIsRecorded(activeItem) ? 'Show' : 'Start'} recording`}
- - }> -
{ - e.stopPropagation(); - this.startRecording(activeItem); - }} - style={{ fontWeight: 700 }}> - e.stopPropagation()} /> -
-
- )} - - {this.indexInPres === 0 ? null : ( - -
{activeItem.groupWithUp ? 'Ungroup' : 'Group with up'}
- - }> -
(activeItem.groupWithUp = !activeItem.groupWithUp)} - style={{ - zIndex: 1000 - this.indexInPres, - fontWeight: 700, - backgroundColor: activeItem.groupWithUp ? (presColorBool ? presBoxColor : Colors.MEDIUM_BLUE) : undefined, - height: activeItem.groupWithUp ? 53 : 18, - transform: activeItem.groupWithUp ? 'translate(0, -17px)' : undefined, - }}> -
- e.stopPropagation()} /> -
+ {this.recordingIsInOverlay ? 'Hide Recording' : `${PresElementBox.videoIsRecorded(activeItem) ? 'Show' : 'Start'} recording`}
}> +
(this.recordingIsInOverlay ? this.hideRecording(e, true) : this.startRecording(e, activeItem))} style={{ fontWeight: 700 }}> + e.stopPropagation()} /> +
+
+ {activeItem.groupWithUp ? 'Ungroup' : 'Group with up'}
}> +
(activeItem.groupWithUp = !activeItem.groupWithUp)} + style={{ + display: this.indexInPres === 0 ? 'none' : '', + zIndex: 1000 - this.indexInPres, + fontWeight: 700, + backgroundColor: activeItem.groupWithUp ? (presColorBool ? presBoxColor : Colors.MEDIUM_BLUE) : undefined, + height: activeItem.groupWithUp ? 53 : 18, + transform: activeItem.groupWithUp ? 'translate(0, -17px)' : undefined, + }}> +
+ e.stopPropagation()} />
- - )} - -
{this.rootDoc.presExpandInlineButton ? 'Minimize' : 'Expand'}
- - }> +
+ + {this.rootDoc.presExpandInlineButton ? 'Minimize' : 'Expand'}}>
{ e.stopPropagation(); this.presExpandDocumentClick(); @@ -594,18 +541,12 @@ export class PresElementBox extends ViewBoxBaseComponent() { e.stopPropagation()} />
- -
{'Remove from presentation'}
- - }> + Remove from presentation}>
e.stopPropagation()} />
- {/*
{activeItem.presPinView ? (<>View of {targetDoc.title}) : targetDoc.title}
*/} {this.renderEmbeddedInline} )} -- cgit v1.2.3-70-g09d2