diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-05-20 14:37:24 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-05-20 14:37:24 -0400 |
commit | f4d80b5c707b3bbcd9dde34582de2b804fbb6f36 (patch) | |
tree | 0ff48a4bfe8cb4b282875cea1dcaf0f485de435d | |
parent | 99bbb42cfa5718f543213f7a64463bd31c73d781 (diff) | |
parent | e32ccd138ff70f2225e5c2c13e0003e02593ef09 (diff) |
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web
-rw-r--r-- | src/client/views/PresentationView.tsx | 14 | ||||
-rw-r--r-- | src/client/views/collections/collectionFreeForm/MarqueeView.tsx | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/client/views/PresentationView.tsx b/src/client/views/PresentationView.tsx index ce679aa0a..9d5798ff1 100644 --- a/src/client/views/PresentationView.tsx +++ b/src/client/views/PresentationView.tsx @@ -6,7 +6,7 @@ import { DocumentManager } from "../util/DocumentManager"; import { Utils } from "../../Utils"; import { Doc, DocListCast, DocListCastAsync } from "../../new_fields/Doc"; import { listSpec } from "../../new_fields/Schema"; -import { Cast, NumCast, FieldValue, PromiseValue, StrCast } from "../../new_fields/Types"; +import { Cast, NumCast, FieldValue, PromiseValue, StrCast, BoolCast } from "../../new_fields/Types"; import { Id } from "../../new_fields/FieldSymbols"; import { List } from "../../new_fields/List"; import { CurrentUserUtils } from "../../server/authentication/models/current_user_utils"; @@ -27,6 +27,7 @@ interface PresListProps extends PresViewProps { */ class PresentationViewList extends React.Component<PresListProps> { + /** * Renders a single child document. It will just append a list element. * @param document The document to render. @@ -42,8 +43,17 @@ class PresentationViewList extends React.Component<PresListProps> { //this doc is selected className += " presentationView-selected"; } + let onEnter = (e: React.PointerEvent) => { document.libraryBrush = true; } + let onLeave = (e: React.PointerEvent) => { document.libraryBrush = false; } return ( - <div className={className} key={document[Id] + index} onClick={e => { this.props.gotoDocument(index); e.stopPropagation(); }}> + <div className={className} key={document[Id] + index} + onPointerEnter={onEnter} onPointerLeave={onLeave} + style={{ + outlineColor: "maroon", + outlineStyle: "dashed", + outlineWidth: BoolCast(document.libraryBrush, false) || BoolCast(document.protoBrush, false) ? `1px` : "0px", + }} + onClick={e => { this.props.gotoDocument(index); e.stopPropagation(); }}> <strong className="presentationView-name"> {`${index + 1}. ${title}`} </strong> diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx index 6ea230aab..97e610e13 100644 --- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx +++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx @@ -135,7 +135,7 @@ export class MarqueeView extends React.Component<MarqueeViewProps> document.addEventListener("pointerup", this.onPointerUp, true); document.addEventListener("keydown", this.marqueeCommand, true); if (e.altKey) { - e.stopPropagation(); + //e.stopPropagation(); // bcz: removed so that you can alt-click on button in a collection to switch link following behaviors. e.preventDefault(); } // bcz: do we need this? it kills the context menu on the main collection if !altKey |