can click on linetext to select them

This commit is contained in:
sawka 2022-12-06 10:24:44 -08:00
parent 0620ff5d85
commit ff2ddd90a2
2 changed files with 13 additions and 2 deletions

View File

@ -159,13 +159,19 @@ class LineAvatar extends React.Component<{line : LineType, cmd : Cmd}, {}> {
@mobxReact.observer
class LineText extends React.Component<{sw : ScreenWindow, line : LineType}, {}> {
@boundMethod
clickHandler() {
let {line} = this.props;
GlobalCommandRunner.swSelectLine(String(line.linenum));
}
render() {
let {sw, line} = this.props;
let formattedTime = getLineDateStr(line.ts);
let isSelected = (sw.selectedLine.get() == line.linenum);
let isFocused = (sw.focusType.get() == "cmd");
return (
<div className="line line-text" data-lineid={line.lineid} data-linenum={line.linenum} data-windowid={line.windowid}>
<div className="line line-text" data-lineid={line.lineid} data-linenum={line.linenum} data-windowid={line.windowid} onClick={this.clickHandler}>
<div className={cn("focus-indicator", {"selected": isSelected}, {"active": isSelected && isFocused})}/>
<div className="avatar">
S

View File

@ -390,7 +390,7 @@ html, body, #main {
flex-direction: column;
scroll-margin-bottom: 20px;
position: relative;
.avatar {
cursor: pointer;
}
@ -526,6 +526,11 @@ html, body, #main {
border-top: none;
}
&:hover .focus-indicator {
display: block;
background-color: #222;
}
.focus-indicator {
position: absolute;
display: none;