mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
add focus indicator to comment lines
This commit is contained in:
+4
-1
@@ -138,10 +138,13 @@ function getLineDateStr(ts : number) : string {
|
||||
@mobxReact.observer
|
||||
class LineText extends React.Component<{sw : ScreenWindow, line : LineType}, {}> {
|
||||
render() {
|
||||
let line = this.props.line;
|
||||
let {sw, line} = this.props;
|
||||
let formattedTime = getLineDateStr(line.ts);
|
||||
let isSelected = (sw.selectedLine.get() == line.linenum);
|
||||
let isFocused = (sw.focusType.get() == "lines");
|
||||
return (
|
||||
<div className="line line-text" data-lineid={line.lineid} data-linenum={line.linenum} data-windowid={line.windowid}>
|
||||
<div className={cn("focus-indicator", {"selected": isSelected}, {"active": isSelected && isFocused})}/>
|
||||
<div className="avatar">
|
||||
S
|
||||
</div>
|
||||
|
||||
@@ -1424,10 +1424,18 @@ class Model {
|
||||
}
|
||||
|
||||
onICmd(e : any, mods : KeyModsType) {
|
||||
let sw = this.getActiveSW();
|
||||
if (sw != null) {
|
||||
sw.setFocusType("input");
|
||||
}
|
||||
this.inputModel.giveFocus();
|
||||
}
|
||||
|
||||
onLCmd(e : any, mods : KeyModsType) {
|
||||
let sw = this.getActiveSW();
|
||||
if (sw != null) {
|
||||
sw.setFocusType("lines");
|
||||
}
|
||||
// this.inputModel.giveCmdFocus();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user