aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-08-20 21:37:32 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-08-20 21:37:32 -0400
commitc0439996ec8b4858c48a7871120e19bb7c06c67d (patch)
tree5efd268f5cf119909f5c955b2710191698bcf47f /src
parent820ad7343816ee9d5881eefdbcbe8783fe903257 (diff)
drag and drop google docs tweaks
Diffstat (limited to 'src')
-rw-r--r--src/client/DocServer.ts1
-rw-r--r--src/client/views/collections/CollectionSubView.tsx8
-rw-r--r--src/client/views/nodes/FormattedTextBox.tsx1
3 files changed, 5 insertions, 5 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts
index 56d9147ae..2cec1046b 100644
--- a/src/client/DocServer.ts
+++ b/src/client/DocServer.ts
@@ -5,7 +5,6 @@ import { Utils, emptyFunction } from '../Utils';
import { SerializationHelper } from './util/SerializationHelper';
import { RefField } from '../new_fields/RefField';
import { Id, HandleUpdate } from '../new_fields/FieldSymbols';
-import { docs_v1 } from 'googleapis';
/**
* This class encapsulates the transfer and cross-client synchronization of
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index 3deec22b5..5b50c545c 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -17,7 +17,7 @@ import { DragManager } from "../../util/DragManager";
import { undoBatch, UndoManager } from "../../util/UndoManager";
import { DocComponent } from "../DocComponent";
import { FieldViewProps } from "../nodes/FieldView";
-import { FormattedTextBox, Blank } from "../nodes/FormattedTextBox";
+import { FormattedTextBox, GoogleRef } from "../nodes/FormattedTextBox";
import { CollectionPDFView } from "./CollectionPDFView";
import { CollectionVideoView } from "./CollectionVideoView";
import { CollectionView } from "./CollectionView";
@@ -209,11 +209,11 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) {
}
let matches: RegExpExecArray | null;
if ((matches = /(https:\/\/)?docs\.google\.com\/document\/d\/([^\\]+)\/edit/g.exec(text)) !== null) {
- let newBox = Docs.Create.TextDocument({ ...options, width: 600, height: 400, title: "Fetching title from Google Docs..." });
+ let newBox = Docs.Create.TextDocument({ ...options, width: 400, height: 200, title: "Awaiting title from Google Docs..." });
let proto = newBox.proto!;
proto.autoHeight = true;
- proto.googleDocId = matches[2];
- proto.data = "Fetching contents from Google Docs...";
+ proto[GoogleRef] = matches[2];
+ proto.data = "Please select and then click on this document's pull button to load its contents from from Google Docs...";
proto.backgroundColor = "#eeeeff";
this.props.addDocument(newBox);
return;
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index d4cbb5116..2b01fb70a 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -434,6 +434,7 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe
delete dataDoc[GoogleRef];
}
DocumentDecorations.Instance.startPullOutcome(pullSuccess);
+ this.tryUpdateHeight();
}
checkState = (exportState: GoogleApiClientUtils.Docs.ReadResult, dataDoc: Doc) => {