mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Merge pull request #2208 from enyaxu/feature/2132
New Feature: Shortcuts for focusing tag editor(CmdOrControl+Shift+T)(#2132)
This commit is contained in:
@@ -441,7 +441,7 @@ class SnippetNoteDetail extends React.Component {
|
||||
const isSuper = global.process.platform === 'darwin'
|
||||
? e.metaKey
|
||||
: e.ctrlKey
|
||||
if (isSuper) {
|
||||
if (isSuper && !e.shiftKey) {
|
||||
e.preventDefault()
|
||||
this.addSnippet()
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import styles from './TagSelect.styl'
|
||||
import _ from 'lodash'
|
||||
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||
import i18n from 'browser/lib/i18n'
|
||||
import ee from 'browser/main/lib/eventEmitter'
|
||||
|
||||
class TagSelect extends React.Component {
|
||||
constructor (props) {
|
||||
@@ -13,16 +14,26 @@ class TagSelect extends React.Component {
|
||||
this.state = {
|
||||
newTag: ''
|
||||
}
|
||||
this.addtagHandler = this.handleAddTag.bind(this)
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
this.value = this.props.value
|
||||
ee.on('editor:add-tag', this.addtagHandler)
|
||||
}
|
||||
|
||||
componentDidUpdate () {
|
||||
this.value = this.props.value
|
||||
}
|
||||
|
||||
componentWillUnmount () {
|
||||
ee.off('editor:add-tag', this.addtagHandler)
|
||||
}
|
||||
|
||||
handleAddTag () {
|
||||
this.refs.newTag.focus()
|
||||
}
|
||||
|
||||
handleNewTagInputKeyDown (e) {
|
||||
switch (e.keyCode) {
|
||||
case 9:
|
||||
|
||||
Reference in New Issue
Block a user