aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/TooltipTextMenu.tsx
diff options
context:
space:
mode:
authorkimdahey <claire_kim1@brown.edu>2019-09-21 15:43:22 -0400
committerkimdahey <claire_kim1@brown.edu>2019-09-21 15:43:22 -0400
commit0b0789816e8a996b32d92e305da84b5922a49f40 (patch)
treee0a5ae13305c3f4d20413c5930f8281741fade98 /src/client/util/TooltipTextMenu.tsx
parentf520d5a821b515e0c216f055e93f0549bd6733a9 (diff)
parent1d5dc3eb4095cea017412de9519b8eaee979c16c (diff)
merge conflicts
Diffstat (limited to 'src/client/util/TooltipTextMenu.tsx')
-rw-r--r--src/client/util/TooltipTextMenu.tsx16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/client/util/TooltipTextMenu.tsx b/src/client/util/TooltipTextMenu.tsx
index 50aec3005..a2653855c 100644
--- a/src/client/util/TooltipTextMenu.tsx
+++ b/src/client/util/TooltipTextMenu.tsx
@@ -58,10 +58,6 @@ export class TooltipTextMenu {
private _collapsed: boolean = false;
- @observable
- private _storedMarks: Mark<any>[] | null | undefined;
-
-
constructor(view: EditorView, editorProps: FieldViewProps & FormattedTextBoxProps) {
this.view = view;
this.editorProps = editorProps;
@@ -84,8 +80,6 @@ export class TooltipTextMenu {
this.dragElement(dragger);
- this._storedMarks = this.view.state.storedMarks;
-
// this.createCollapse();
// if (this._collapseBtn) {
// this.tooltip.appendChild(this._collapseBtn.render(this.view).dom);
@@ -280,7 +274,7 @@ export class TooltipTextMenu {
if (DocumentManager.Instance.getDocumentView(f)) {
DocumentManager.Instance.getDocumentView(f)!.props.focus(f, false);
}
- else if (CollectionDockingView.Instance) CollectionDockingView.Instance.AddRightSplit(f, undefined);
+ else this.editorProps.addDocTab(f, undefined, "onRight");
}
}));
}
@@ -311,8 +305,8 @@ export class TooltipTextMenu {
let linkDoc = dragData.linkDocument;
let guid = Utils.GenerateGuid();
let proto = Doc.GetProto(linkDoc);
- if (proto && docView && docView.props.ContainingCollectionView) {
- proto.sourceContext = docView.props.ContainingCollectionView.props.Document;
+ if (proto && docView) {
+ proto.sourceContext = docView.props.ContainingCollectionDoc;
}
linkDoc.guid = guid;
linkDoc instanceof Doc && this.makeLink(Utils.prepend("/doc/" + linkDoc[Id]), ctrlKey ? "onRight" : "inTab", guid);
@@ -525,12 +519,12 @@ export class TooltipTextMenu {
tx2.doc.descendants((node: any, offset: any, index: any) => {
if (node.type === schema.nodes.ordered_list || node.type === schema.nodes.list_item) {
let path = (tx2.doc.resolve(offset) as any).path;
- let depth = Array.from(path).reduce((p: number, c: any) => p + (c.hasOwnProperty("type") && (c as any).type === schema.nodes.ordered_list ? 1 : 0), 0);
+ let depth = Array.from(path).reduce((p: number, c: any) => p + (c.hasOwnProperty("type") && c.type === schema.nodes.ordered_list ? 1 : 0), 0);
if (node.type === schema.nodes.ordered_list) depth++;
tx2.setNodeMarkup(offset, node.type, { mapStyle: style, bulletStyle: depth }, node.marks);
}
});
- };
+ }
//remove all node typeand apply the passed-in one to the selected text
changeToNodeType = (nodeType: NodeType | undefined, view: EditorView) => {
//remove oldif (nodeType) { //add new