diff options
author | ab <abdullah_ahmed@brown.edu> | 2019-07-22 10:30:43 -0400 |
---|---|---|
committer | ab <abdullah_ahmed@brown.edu> | 2019-07-22 10:30:43 -0400 |
commit | db7a71ba79899d771693a0bff5dfda81bead2fa3 (patch) | |
tree | 3001d83afbba2e93846b9b40dc587b45bcdcdbca | |
parent | 9475d666a2a2b443ef040838f73e042903c75e00 (diff) | |
parent | 00f466d3b79eebcb9be42a5d88c8dc083a7be376 (diff) |
Merge branch 'text_box_ab' of https://github.com/browngraphicslab/Dash-Web into text_box_ab
-rw-r--r-- | src/client/util/TooltipTextMenu.tsx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/util/TooltipTextMenu.tsx b/src/client/util/TooltipTextMenu.tsx index 0c2645a5c..0c81eda2b 100644 --- a/src/client/util/TooltipTextMenu.tsx +++ b/src/client/util/TooltipTextMenu.tsx @@ -109,8 +109,10 @@ export class TooltipTextMenu { if (dom.contains(e.target as Node)) { e.stopPropagation(); command(view.state, view.dispatch, view); - if (dom.style.color === "white") { dom.style.color = "greenyellow"; } - else { dom.style.color = "white"; } + if (this.view.state.selection.empty) { + if (dom.style.color === "white") { dom.style.color = "greenyellow"; } + else { dom.style.color = "white"; } + } } }); @@ -760,7 +762,7 @@ export class TooltipTextMenu { //finds all active marks on selection in given group activeMarksOnSelection(markGroup: MarkType[]) { //current selection - let { empty, ranges } = this.view.state.selection as TextSelection; + let { empty, ranges, $to } = this.view.state.selection as TextSelection; let state = this.view.state; let dispatch = this.view.dispatch; let activeMarks: MarkType[]; @@ -775,6 +777,9 @@ export class TooltipTextMenu { } return false; }); + + const refnode = this.reference_node($to); + this._activeMarks = refnode.marks; } else { const pos = this.view.state.selection.$from; |