aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentButtonBar.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/DocumentButtonBar.tsx')
-rw-r--r--src/client/views/DocumentButtonBar.tsx74
1 files changed, 9 insertions, 65 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index 3938b81cd..63d2a5e08 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -25,27 +25,10 @@ import { DashFieldView } from './nodes/formattedText/DashFieldView';
import { PinProps } from './nodes/trails';
import { faCalendarDays } from '@fortawesome/free-solid-svg-icons';
-const cloud: IconProp = 'cloud-upload-alt';
-const fetch: IconProp = 'sync-alt';
-
-enum UtilityButtonState {
- Default,
- OpenRight,
- OpenExternally,
-}
-
@observer
export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (DocumentView | undefined)[]; stack?: any }> {
private _dragRef = React.createRef<HTMLDivElement>();
- private _pullAnimating = false;
- private _pushAnimating = false;
- private _pullColorAnimating = false;
- @observable public isAnimatingFetch = false;
- @observable public isAnimatingPulse = false;
-
@observable public static Instance: DocumentButtonBar;
- public static hasPushedHack = false;
- public static hasPulledHack = false;
constructor(props: any) {
super(props);
@@ -53,51 +36,6 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
DocumentButtonBar.Instance = this;
}
- public startPullOutcome = action((success: boolean) => {
- if (!this._pullAnimating) {
- this._pullAnimating = true;
- this.pullIcon = success ? 'check-circle' : 'stop-circle';
- setTimeout(
- () =>
- runInAction(() => {
- this.pullIcon = 'arrow-alt-circle-down';
- this._pullAnimating = false;
- }),
- 1000
- );
- }
- });
-
- public startPushOutcome = action((success: boolean) => {
- this.isAnimatingPulse = false;
- if (!this._pushAnimating) {
- this._pushAnimating = true;
- this.pushIcon = success ? 'check-circle' : 'stop-circle';
- setTimeout(
- () =>
- runInAction(() => {
- this.pushIcon = 'arrow-alt-circle-up';
- this._pushAnimating = false;
- }),
- 1000
- );
- }
- });
-
- public setPullState = action((unchanged: boolean) => {
- this.isAnimatingFetch = false;
- if (!this._pullColorAnimating) {
- this._pullColorAnimating = true;
- this.pullColor = unchanged ? 'lawngreen' : 'red';
- setTimeout(this.clearPullColor, 1000);
- }
- });
-
- private clearPullColor = action(() => {
- this.pullColor = 'white';
- this._pullColorAnimating = false;
- });
-
get view0() {
return this._props.views()?.[0];
}
@@ -367,7 +305,7 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
if (this._dragRef.current) {
const dragDocView = this.view0!;
const dragData = new DragManager.DocumentDragData([dragDocView.Document]);
- const [left, top] = dragDocView._props.ScreenToLocalTransform().inverse().transformPoint(0, 0);
+ const [left, top] = dragDocView.screenToLocalTransform().inverse().transformPoint(0, 0);
dragData.defaultDropAction = 'embed';
dragData.canEmbed = true;
DragManager.StartDocumentDrag([dragDocView.ContentDiv!], dragData, left, top, { hideSource: false });
@@ -385,7 +323,8 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
return !view0 ? null : (
<Tooltip title={<div className="dash-tooltip">Tap to Customize Layout. Drag an embedding</div>} open={this._tooltipOpen} onClose={action(() => (this._tooltipOpen = false))} placement="bottom">
<div className="documentButtonBar-linkFlyout" ref={this._dragRef} onPointerEnter={action(() => !this._ref.current?.getBoundingClientRect().width && (this._tooltipOpen = true))}>
- {/* <Flyout
+ {
+ /* <Flyout
anchorPoint={anchorPoints.LEFT_TOP}
onOpen={action(() => (this._embedDown = true))}
onClose={action(() => (this._embedDown = false))}
@@ -400,7 +339,12 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (
<div className={'documentButtonBar-linkButton-empty'} ref={this._dragRef} onPointerDown={this.onTemplateButton}>
<FontAwesomeIcon className="documentdecorations-icon" icon="edit" size="sm" />
</div>
- </Flyout> */}
+ </Flyout> */
+
+ <div className={'documentButtonBar-linkButton-empty'} ref={this._dragRef} onPointerDown={this.onTemplateButton}>
+ <FontAwesomeIcon className="documentdecorations-icon" icon="edit" size="sm" />
+ </div>
+ }
</div>
</Tooltip>
);