diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/linking/LinkEditor.scss | 14 | ||||
-rw-r--r-- | src/client/views/linking/LinkEditor.tsx | 33 | ||||
-rw-r--r-- | src/client/views/linking/LinkMenu.scss | 2 | ||||
-rw-r--r-- | src/client/views/linking/LinkMenu.tsx | 17 | ||||
-rw-r--r-- | src/client/views/linking/LinkMenuItem.tsx | 4 |
5 files changed, 36 insertions, 34 deletions
diff --git a/src/client/views/linking/LinkEditor.scss b/src/client/views/linking/LinkEditor.scss index 5f0e5e18a..406a38c26 100644 --- a/src/client/views/linking/LinkEditor.scss +++ b/src/client/views/linking/LinkEditor.scss @@ -41,9 +41,9 @@ } .linkEditor-description-input { - border: 1px solid rgb(114, 162, 179); + border: 1px solid grey; border-radius: 4px; - background-color: lightblue; + background-color: rgb(236, 236, 236); padding-left: 2px; padding-right: 2px; color: grey; @@ -60,9 +60,9 @@ .linkEditor-followingDropdown-header { - border: 1px solid rgb(114, 162, 179); + border: 1px solid grey; border-radius: 4px; - background-color: lightblue; + background-color: rgb(236, 236, 236); padding-left: 2px; padding-right: 2px; color: grey; @@ -78,8 +78,8 @@ padding-right: 3px; .linkEditor-followingDropdown-option { - border: 0.25px dotted rgb(114, 162, 179); - background-color: lightblue; + border: 0.25px dotted grey; + background-color: rgb(236, 236, 236); padding-left: 2px; padding-right: 2px; color: grey; @@ -87,7 +87,7 @@ font-size: 9px; &:hover { - background-color: rgb(141, 197, 216); + background-color: rgb(211, 210, 210); } } diff --git a/src/client/views/linking/LinkEditor.tsx b/src/client/views/linking/LinkEditor.tsx index 3adf44339..93aae0852 100644 --- a/src/client/views/linking/LinkEditor.tsx +++ b/src/client/views/linking/LinkEditor.tsx @@ -12,6 +12,7 @@ import React = require("react"); import { DocumentView } from "../nodes/DocumentView"; import { DocumentLinksButton } from "../nodes/DocumentLinksButton"; import { EditableView } from "../EditableView"; +import { RefObject } from "react"; library.add(faArrowLeft, faEllipsisV, faTable, faTrash, faCog, faExchangeAlt, faTimes, faPlus); @@ -346,22 +347,21 @@ export class LinkEditor extends React.Component<LinkEditorProps> { icon={this.openDropdown ? "chevron-up" : "chevron-down"} size={"sm"} onPointerDown={this.changeDropdown} /> </div> - {this.openDropdown ? - <div className="linkEditor-followingDropdown-optionsList"> - <div className="linkEditor-followingDropdown-option" - onPointerDown={() => this.changeFollowBehavior("Default")}> - Default + <div className="linkEditor-followingDropdown-optionsList" + style={{ display: this.openDropdown ? "" : "none" }}> + <div className="linkEditor-followingDropdown-option" + onPointerDown={() => this.changeFollowBehavior("Default")}> + Default </div> - <div className="linkEditor-followingDropdown-option" - onPointerDown={() => this.changeFollowBehavior("Always open in right tab")}> - Always open in right tab + <div className="linkEditor-followingDropdown-option" + onPointerDown={() => this.changeFollowBehavior("Always open in right tab")}> + Always open in right tab </div> - <div className="linkEditor-followingDropdown-option" - onPointerDown={() => this.changeFollowBehavior("Always open in new tab")}> - Always open in new tab + <div className="linkEditor-followingDropdown-option" + onPointerDown={() => this.changeFollowBehavior("Always open in new tab")}> + Always open in new tab </div> - </div> - : null} + </div> </div> </div>; } @@ -377,9 +377,10 @@ export class LinkEditor extends React.Component<LinkEditorProps> { return !destination ? (null) : ( <div className="linkEditor"> <div className="linkEditor-info"> - {this.props.hideback ? (null) : <button className="linkEditor-button-back" - onPointerDown={this.props.showLinks}> - <FontAwesomeIcon icon="arrow-left" size="sm" /></button>} + <button className="linkEditor-button-back" + style={{ display: this.props.hideback ? "none" : "" }} + onClick={this.props.showLinks}> + <FontAwesomeIcon icon="arrow-left" size="sm" /> </button> <p className="linkEditor-linkedTo">editing link to: <b>{ destination.proto?.title ?? destination.title ?? "untitled"}</b></p> <button className="linkEditor-button" onPointerDown={() => this.deleteLink()} title="Delete link"> diff --git a/src/client/views/linking/LinkMenu.scss b/src/client/views/linking/LinkMenu.scss index b0c729cda..4b1a3f425 100644 --- a/src/client/views/linking/LinkMenu.scss +++ b/src/client/views/linking/LinkMenu.scss @@ -3,7 +3,7 @@ .linkMenu { width: 100%; height: auto; - border: 1px solid black; + //border: 1px solid black; &:hover { width: calc(auto + 26px); diff --git a/src/client/views/linking/LinkMenu.tsx b/src/client/views/linking/LinkMenu.tsx index c2e410b73..8a7b12f48 100644 --- a/src/client/views/linking/LinkMenu.tsx +++ b/src/client/views/linking/LinkMenu.tsx @@ -80,13 +80,14 @@ export class LinkMenu extends React.Component<Props> { render() { const sourceDoc = this.props.docView.props.Document; const groups: Map<string, Doc[]> = LinkManager.Instance.getRelatedGroupedLinks(sourceDoc); - return <div className="linkMenu-list" - ref={this._linkMenuRef} style={{ left: this.props.location[0], top: this.props.location[1] }}> - {!this._editingLink ? - this.renderAllGroups(groups) : - <LinkEditor sourceDoc={this.props.docView.props.Document} linkDoc={this._editingLink} - showLinks={action(() => this._editingLink = undefined)} /> - } - </div>; + return <div className="linkMenu" ref={this._linkMenuRef} > + <div className="linkMenu-list" + style={{ left: this.props.location[0], top: this.props.location[1] }}> + {!this._editingLink ? + this.renderAllGroups(groups) : + <LinkEditor sourceDoc={this.props.docView.props.Document} linkDoc={this._editingLink} + showLinks={action(() => this._editingLink = undefined)} /> + } + </div> </div>; } }
\ No newline at end of file diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx index bd4024902..6af474513 100644 --- a/src/client/views/linking/LinkMenuItem.tsx +++ b/src/client/views/linking/LinkMenuItem.tsx @@ -155,9 +155,9 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> { if (this.props.linkDoc.follow === "Default") { DocumentManager.Instance.FollowLink(this.props.linkDoc, this.props.sourceDoc, doc => this.props.addDocTab(doc, "onRight"), false); } else if (this.props.linkDoc.follow === "Always open in right tab") { - this.props.addDocTab(this.props.sourceDoc, "onRight"); + this.props.addDocTab(this.props.destinationDoc, "onRight"); } else if (this.props.linkDoc.follow === "Always open in new tab") { - this.props.addDocTab(this.props.sourceDoc, "inTab"); + this.props.addDocTab(this.props.destinationDoc, "inTab"); } } else { DocumentManager.Instance.FollowLink(this.props.linkDoc, this.props.sourceDoc, doc => this.props.addDocTab(doc, "onRight"), false); |