diff options
| author | Melissa Zhang <mzhang19096@gmail.com> | 2020-08-03 15:15:33 -0700 |
|---|---|---|
| committer | Melissa Zhang <mzhang19096@gmail.com> | 2020-08-03 15:15:33 -0700 |
| commit | e9737412cb3d60ed76c31c9571e9516518cddd77 (patch) | |
| tree | 407f4a4cbc4947d4057d317dc3a8b7369197c01d /src/client/views/linking | |
| parent | 1713f5415294b996e6dbbe9ca45f0f4511c69824 (diff) | |
| parent | ef5dbc6ad8bdb70f3e68d2fc4ace1a483b031add (diff) | |
merge with master
Diffstat (limited to 'src/client/views/linking')
| -rw-r--r-- | src/client/views/linking/LinkEditor.tsx | 25 | ||||
| -rw-r--r-- | src/client/views/linking/LinkMenuItem.tsx | 4 |
2 files changed, 12 insertions, 17 deletions
diff --git a/src/client/views/linking/LinkEditor.tsx b/src/client/views/linking/LinkEditor.tsx index 737e0ca28..fb014af51 100644 --- a/src/client/views/linking/LinkEditor.tsx +++ b/src/client/views/linking/LinkEditor.tsx @@ -1,20 +1,16 @@ import { library } from "@fortawesome/fontawesome-svg-core"; import { faArrowLeft, faCog, faEllipsisV, faExchangeAlt, faPlus, faTable, faTimes, faTrash } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { action, observable, computed, toJS } from "mobx"; +import { Tooltip } from "@material-ui/core"; +import { action, computed, observable } from "mobx"; import { observer } from "mobx-react"; -import { Doc, Opt } from "../../../fields/Doc"; -import { StrCast, DateCast } from "../../../fields/Types"; +import { Doc } from "../../../fields/Doc"; +import { DateCast, StrCast } from "../../../fields/Types"; import { Utils } from "../../../Utils"; import { LinkManager } from "../../util/LinkManager"; +import { undoBatch } from "../../util/UndoManager"; import './LinkEditor.scss'; import React = require("react"); -import { DocumentView } from "../nodes/DocumentView"; -import { DocumentLinksButton } from "../nodes/DocumentLinksButton"; -import { EditableView } from "../EditableView"; -import { RefObject } from "react"; -import { Tooltip } from "@material-ui/core"; -import { undoBatch } from "../../util/UndoManager"; library.add(faArrowLeft, faEllipsisV, faTable, faTrash, faCog, faExchangeAlt, faTimes, faPlus); @@ -296,21 +292,18 @@ export class LinkEditor extends React.Component<LinkEditorProps> { //@observable description = this.props.linkDoc.description ? StrCast(this.props.linkDoc.description) : "DESCRIPTION"; - @undoBatch - @action + @undoBatch @action deleteLink = (): void => { LinkManager.Instance.deleteLink(this.props.linkDoc); this.props.showLinks(); } - @action + @undoBatch @action setDescripValue = (value: string) => { if (LinkManager.currentLink) { LinkManager.currentLink.description = value; this.buttonColor = "rgb(62, 133, 55)"; - setTimeout(action(() => { - this.buttonColor = "black"; - }), 750); + setTimeout(action(() => this.buttonColor = "black"), 750); return true; } } @@ -362,7 +355,7 @@ export class LinkEditor extends React.Component<LinkEditorProps> { this.openDropdown = !this.openDropdown; } - @action + @undoBatch @action changeFollowBehavior = (follow: string) => { this.openDropdown = false; Doc.GetProto(this.props.linkDoc).followLinkLocation = follow; diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx index 40a16961a..b29754d45 100644 --- a/src/client/views/linking/LinkMenuItem.tsx +++ b/src/client/views/linking/LinkMenuItem.tsx @@ -180,6 +180,7 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> { DocumentLinksButton.EditLink = undefined; } + @undoBatch @action showLink = () => { this.props.linkDoc.hidden = !this.props.linkDoc.hidden; @@ -195,7 +196,7 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> { switch (this.props.destinationDoc.type) { case DocumentType.IMG: destinationIcon = "image"; break; case DocumentType.COMPARISON: destinationIcon = "columns"; break; - case DocumentType.RTF: destinationIcon = "font"; break; + case DocumentType.RTF: destinationIcon = "sticky-note"; break; case DocumentType.COL: destinationIcon = "folder"; break; case DocumentType.WEB: destinationIcon = "globe-asia"; break; case DocumentType.SCREENSHOT: destinationIcon = "photo-video"; break; @@ -209,6 +210,7 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> { case DocumentType.DOCHOLDER: destinationIcon = "expand"; break; case DocumentType.VID: destinationIcon = "video"; break; case DocumentType.INK: destinationIcon = "pen-nib"; break; + case DocumentType.PDF: destinationIcon = "file"; break; default: destinationIcon = "question"; break; } |
