aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-05-06 11:45:44 -0400
committerbobzel <zzzman@gmail.com>2022-05-06 11:45:44 -0400
commitf072a9f2c1ad69eb8ae4242fa5d2e18bbd94f6ef (patch)
tree03cdb7749b8df377a114f42b8ec205fea5f06af4 /src/client/views/DocumentDecorations.tsx
parentfefed2faee7808f75808f769496564d61d292d07 (diff)
changed following links to open up icons all the way down to the target document. allow StartLink to work with webBox w/ text selection. fixed web clippings to have a cursor and grab keyDown events.
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index eb2bcc18c..936946df0 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -113,7 +113,12 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number, P
}
}
- titleEntered = (e: React.KeyboardEvent) => e.key === "Enter" && (e.target as any).blur();
+ titleEntered = (e: React.KeyboardEvent) => {
+ if (e.key === "Enter") {
+ e.stopPropagation();
+ (e.target as any).blur();
+ }
+ }
@action onTitleDown = (e: React.PointerEvent): void => {
setupMoveUpEvents(this, e, e => this.onBackgroundMove(true, e), (e) => { }, action((e) => {
@@ -288,7 +293,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number, P
if (fixedAspect && (resizeHdl === "documentDecorations-bottomRightResizer" || resizeHdl === "documentDecorations-topLeftResizer")) { // need to generalize for bl and tr drag handles
const project = (p: number[], a: number[], b: number[]) => {
const atob = [b[0] - a[0], b[1] - a[1]];
- const atop = [p[0] - a[0], p[1] - a[1]]; first
+ const atop = [p[0] - a[0], p[1] - a[1]];
const len = atob[0] * atob[0] + atob[1] * atob[1];
let dot = atop[0] * atob[0] + atop[1] * atob[1];
const t = dot / len;
@@ -501,7 +506,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number, P
value={this._accumulatedTitle}
onBlur={e => this.titleBlur()}
onChange={action(e => this._accumulatedTitle = e.target.value)}
- onKeyPress={this.titleEntered} /> :
+ onKeyDown={this.titleEntered} /> :
<div className="documentDecorations-title" key="title" onPointerDown={this.onTitleDown} >
<span className={`documentDecorations-titleSpan${colorScheme}`}>{`${this.selectionTitle}`}</span>
</div>;
@@ -521,7 +526,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number, P
const useRotation = seldoc.ComponentView instanceof InkingStroke || seldoc.ComponentView instanceof ImageBox;
const resizerScheme = colorScheme ? "documentDecorations-resizer" + colorScheme : "";
- const rotation = NumCast(seldoc.rootDoc._jitterRotation)
+ const rotation = NumCast(seldoc.rootDoc._jitterRotation);
const rdeg = rotation / 180 * Math.PI;
return (<div className={`documentDecorations${colorScheme}`}>