diff options
author | laurawilsonri <laura_wilson@brown.edu> | 2019-03-12 16:22:30 -0400 |
---|---|---|
committer | laurawilsonri <laura_wilson@brown.edu> | 2019-03-12 16:22:30 -0400 |
commit | 6974d1ff65f997b045695fa4a6c541a5c1f91e90 (patch) | |
tree | 8e645622bbbe69de8b77a5b4b7ef81ecf7fb4a35 | |
parent | 50477f0a9b0b371b4f381b6cef14030a9d7de21e (diff) |
changed a couple small notes
-rw-r--r-- | src/client/util/TooltipTextMenu.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/util/TooltipTextMenu.tsx b/src/client/util/TooltipTextMenu.tsx index d771ed13f..e01c3a7a4 100644 --- a/src/client/util/TooltipTextMenu.tsx +++ b/src/client/util/TooltipTextMenu.tsx @@ -50,7 +50,9 @@ export class TooltipTextMenu { view.focus(); items.forEach(({ command, dom }) => { if (dom.contains(e.srcElement)) { - command(view.state, view.dispatch, view) + let active = command(view.state, view.dispatch, view); + //uncomment this if we want the bullet button to disappear if current selection is bulleted + // dom.style.display = active ? "" : "none" } }) }) @@ -85,7 +87,7 @@ export class TooltipTextMenu { } } - //this doesn't currently work but hopefully will soon + //this doesn't currently work but could be used to use icons for buttons unorderedListIcon(): HTMLSpanElement { let span = document.createElement("span"); let icon = document.createElement("FontAwesomeIcon"); @@ -118,8 +120,6 @@ export class TooltipTextMenu { // Otherwise, reposition it and update its content this.tooltip.style.display = "" let { from, to } = state.selection - // These are in screen coordinates - //check this - tranform let start = view.coordsAtPos(from), end = view.coordsAtPos(to) // The box in which the tooltip is positioned, to use as base let box = this.tooltip.offsetParent!.getBoundingClientRect() @@ -129,6 +129,7 @@ export class TooltipTextMenu { this.tooltip.style.left = (left - box.left) + "px" let width = Math.abs(start.left - end.left) / 2; let mid = Math.min(start.left, end.left) + width; + //THIS WIDTH IS 15 * NUMBER OF ICONS + 15 this.tooltip.style.width = 120 + "px"; this.tooltip.style.bottom = (box.bottom - start.top) + "px"; |