aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/TooltipTextMenu.tsx
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-06-07 16:37:10 -0400
committerab <abdullah_ahmed@brown.edu>2019-06-07 16:37:10 -0400
commitef24cc445aa466cae3b6c40029f7d7bc9baa81b7 (patch)
tree5d0f1362804eb2b5a8bafe6fee5e060df3536ae8 /src/client/util/TooltipTextMenu.tsx
parent08134c962bab2cd62507415f1a67cd921069d8e3 (diff)
frustrated!
Diffstat (limited to 'src/client/util/TooltipTextMenu.tsx')
-rw-r--r--src/client/util/TooltipTextMenu.tsx24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/client/util/TooltipTextMenu.tsx b/src/client/util/TooltipTextMenu.tsx
index 1f1ad9cd4..366105ad9 100644
--- a/src/client/util/TooltipTextMenu.tsx
+++ b/src/client/util/TooltipTextMenu.tsx
@@ -234,7 +234,12 @@ export class TooltipTextMenu {
this.tooltip.appendChild(this.linkEditor);
let starButton = document.createElement("button");
- starButton.textContent = "ST";
+ // starButton.style.width = '10px';
+ // starButton.style.height = '10px';
+ starButton.style.marginLeft = '10px';
+ starButton.textContent = "Summarize";
+ starButton.style.color = 'black';
+ starButton.style.backgroundColor = 'white';
starButton.onclick = () => {
let state = this.view.state;
this.insertStar(state, this.view.dispatch);
@@ -266,16 +271,21 @@ export class TooltipTextMenu {
link = node && node.marks.find(m => m.type.name === "link");
}
- insertStar(state: any, dispatch: any) {
+ insertStar(state: EditorState<any>, dispatch: any) {
console.log("creating star...");
let type = schema.nodes.star;
- let { $from } = state.selection;
- if (!$from.parent.canReplaceWith($from.index(), $from.index(), type)) {
- return false;
- }
+ //let {$from} = state.selection;
+ let select = state.selection;
if (dispatch) {
- dispatch(state.tr.replaceSelectionWith(type.create()));
+ dispatch(state.tr.setMeta('select.visible', false));
}
+ // console.log($from);
+ // if (!$from.parent.canReplaceWith($from.index(), $from.index(), type)) {
+ // return false;
+ // }
+ // if (dispatch) {
+ // dispatch(state.tr.replaceSelectionWith(type.create()));
+ // }
return true;
}