mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Add comments
This commit is contained in:
@@ -44,11 +44,12 @@ class TopBar extends React.Component {
|
||||
isIME: false
|
||||
})
|
||||
|
||||
// When the key is an alphabet, del, enter or ctr
|
||||
if (e.keyCode <= 90) {
|
||||
this.setState({
|
||||
isAlphabet: true,
|
||||
isIME: false
|
||||
isAlphabet: true
|
||||
})
|
||||
// When the key is an IME input (Japanese, Chinese)
|
||||
} else if (e.keyCode === 229) {
|
||||
this.setState({
|
||||
isIME: true
|
||||
@@ -58,6 +59,12 @@ class TopBar extends React.Component {
|
||||
|
||||
|
||||
handleKeyUp (e) {
|
||||
// reset states
|
||||
this.setState({
|
||||
isConfirmTranslation: false
|
||||
})
|
||||
|
||||
// When the key is translation confirmation (Enter)
|
||||
if (this.state.isIME && e.keyCode === 13) {
|
||||
this.setState({
|
||||
isConfirmTranslation: true
|
||||
@@ -67,10 +74,6 @@ class TopBar extends React.Component {
|
||||
this.setState({
|
||||
search: this.refs.searchInput.value
|
||||
})
|
||||
} else {
|
||||
this.setState({
|
||||
isConfirmTranslation: false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user