diff options
| author | Stanley Yip <stanley_yip@brown.edu> | 2019-10-13 15:58:23 -0400 |
|---|---|---|
| committer | Stanley Yip <stanley_yip@brown.edu> | 2019-10-13 15:58:23 -0400 |
| commit | b50381f4872d4e5eaa6d1d8949ea4e10d468cfd8 (patch) | |
| tree | c2939d230a5618aa609e4db84bfdee923bad80bd /src/client/views/pdf/PDFMenu.tsx | |
| parent | bd796f24677b2aacd32a371da6d2b7c7eb354018 (diff) | |
| parent | baf6ed901d341cade58741d363bbc475519558ae (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into interaction_stanley
Diffstat (limited to 'src/client/views/pdf/PDFMenu.tsx')
| -rw-r--r-- | src/client/views/pdf/PDFMenu.tsx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/client/views/pdf/PDFMenu.tsx b/src/client/views/pdf/PDFMenu.tsx index 1997ee0f5..c64741769 100644 --- a/src/client/views/pdf/PDFMenu.tsx +++ b/src/client/views/pdf/PDFMenu.tsx @@ -5,6 +5,7 @@ import { observer } from "mobx-react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { unimplementedFunction, returnFalse } from "../../../Utils"; import AntimodeMenu from "../AntimodeMenu"; +import { Doc, Opt } from "../../../new_fields/Doc"; @observer export default class PDFMenu extends AntimodeMenu { @@ -21,7 +22,7 @@ export default class PDFMenu extends AntimodeMenu { @observable public Status: "pdf" | "annotation" | "snippet" | "" = ""; public StartDrag: (e: PointerEvent, ele: HTMLElement) => void = unimplementedFunction; - public Highlight: (color: string) => void = unimplementedFunction; + public Highlight: (color: string) => Opt<Doc> = (color: string) => undefined; public Delete: () => void = unimplementedFunction; public Snippet: (marquee: { left: number, top: number, width: number, height: number }) => void = unimplementedFunction; public AddTag: (key: string, value: string) => boolean = returnFalse; @@ -70,12 +71,8 @@ export default class PDFMenu extends AntimodeMenu { @action highlightClicked = (e: React.MouseEvent) => { - if (!this.Pinned) { - this.Highlight("#f4f442"); - } - else { + if (!this.Highlight("rgba(245, 230, 95, 0.616)") && this.Pinned) { // yellowish highlight color for a marker type highlight this.Highlighting = !this.Highlighting; - this.Highlight("#f4f442"); } } |
