Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commite8698f1

Browse files
committed
chore: Merge branch 'fix/doramon' into dev
2 parents7085b62 +44ee573 commite8698f1

File tree

3 files changed

+14
-106
lines changed

3 files changed

+14
-106
lines changed

‎containers/Doraemon/InputEditor.js‎

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
}from'./logic'
2121

2222
constInputEditor=({ searching, value, prefix})=>{
23-
useShortcut(['ctrl+c','ctrl+g'],hidePanel)
23+
useShortcut(['ctrl+c','ctrl+g','esc'],hidePanel)
2424
useShortcut('ctrl+p',()=>navSuggestion('up'))
2525
useShortcut('ctrl+n',()=>navSuggestion('down'))
2626

@@ -46,54 +46,3 @@ const InputEditor = ({ searching, value, prefix }) => {
4646
}
4747

4848
exportdefaultInputEditor
49-
50-
/*
51-
52-
export default class InputEditor extends React.Component {
53-
@keydown(['ctrl+g', 'ctrl+c'])
54-
hidePanel() {
55-
hidePanel()
56-
}
57-
58-
// Prevent default behavior in text input while pressing arrow up
59-
// https://stackoverflow.com/questions/1080532/prevent-default-behavior-in-text-input-while-pressing-arrow-up
60-
@keydown(['ctrl+p'])
61-
up(e) {
62-
navSuggestion('up')
63-
e.preventDefault()
64-
}
65-
66-
@keydown(['ctrl+n'])
67-
down(e) {
68-
navSuggestion('down')
69-
e.preventDefault()
70-
}
71-
72-
render() {
73-
const { searching, value, prefix } = this.props
74-
75-
// if you want to use innerRef
76-
// see https://github.com/styled-components/styled-components/issues/102
77-
// innerRef={input => (this.doraemonInput = input)}
78-
return (
79-
<EditorBar>
80-
<PrefixWraper>
81-
<InputPrefix prefix={prefix} searching={searching} />
82-
</PrefixWraper>
83-
<InputBar
84-
id="doraemonInputbar"
85-
spellCheck={false}
86-
autoCapitalize="off"
87-
autoCorrect="off"
88-
autoComplete="off"
89-
onKeyDown={logic.handleKeyDown}
90-
onBlur={logic.inputOnBlur}
91-
onChange={logic.inputOnChange}
92-
value={value}
93-
placeholder="type ? for help"
94-
/>
95-
</EditorBar>
96-
)
97-
}
98-
}
99-
*/

‎containers/Doraemon/ResultsList.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
HintEnter,
1818
}from'./styles/results_list'
1919

20-
import{navToSuggestion,selectSuggestion}from'./logic'
20+
import{navToSuggestion,suggestionOnSelect}from'./logic'
2121

2222
constHintIcon=({ index, active, cur, length})=>{
2323
if(active===cur){
@@ -38,7 +38,7 @@ const ResultsList = ({ searchValue, searchThread, suggestions, activeRaw }) => (
3838
key={suggestion.raw}
3939
id={suggestion.raw}
4040
onMouseEnter={navToSuggestion.bind(this,suggestion)}
41-
onClick={selectSuggestion}
41+
onClick={suggestionOnSelect}
4242
>
4343
<SuggestIcon
4444
raw={suggestion.raw}

‎containers/Doraemon/logic/index.js‎

Lines changed: 11 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,22 @@ export const handleKeyDown = e => {
8888
exportconstnavSuggestion=direction=>SAK.navSuggestion(direction)
8989
// mounseEnter
9090
exportconstnavToSuggestion=suggestion=>SAK.navToSuggestion(suggestion)
91-
exportconstselectSuggestion=()=>{
91+
exportconstsuggestionOnSelect=()=>{
9292
if(store.showThreadSelector)returndoNavigate()
9393
doSpecCmd()
9494
}
9595

9696
exportconstinputOnBlur=()=>{
97-
if(R.contains(store.prefix,['/','?','@'])){
98-
hidePanel()
99-
}
100-
101-
if(!store.showThreadSelector&&R.isEmpty(store.prefix)){
102-
hidePanel()
103-
}
97+
returnfalse
98+
// if (R.contains(store.prefix, ['/', '?', '@'])) {
99+
// log('11')
100+
// hidePanel()
101+
// }
102+
103+
// if (!store.showThreadSelector && R.isEmpty(store.prefix)) {
104+
// log('22')
105+
// hidePanel()
106+
// }
104107
}
105108

106109
// do dearch when thread changes
@@ -545,47 +548,3 @@ export const useInit = _store => {
545548
}
546549
},[_store])
547550
}
548-
549-
/*
550-
551-
export const init2 = _store => {
552-
if (store) return false
553-
554-
store = _store
555-
556-
pockect$ = new Pocket(store)
557-
SAK = new SwissArmyKnife(store)
558-
559-
initSpecCmdResolver()
560-
561-
pockect$.search().subscribe(res => {
562-
if (R.isEmpty(res)) return emptySearchStates()
563-
564-
store.markState({
565-
searching: true,
566-
showThreadSelector: true,
567-
showAlert: false,
568-
showUtils: false,
569-
})
570-
searchContents(store, sr71$, res)
571-
})
572-
573-
pockect$.searchUser().subscribe(name => {
574-
const nickname = R.slice(1, Infinity, name)
575-
store.markState({
576-
prefix: '@',
577-
searchThread: THREAD.USER,
578-
showThreadSelector: true,
579-
showAlert: false,
580-
})
581-
if (R.isEmpty(nickname)) return false
582-
searchContents(store, sr71$, nickname)
583-
})
584-
585-
pockect$.cmdSuggesttion().subscribe(res => store.loadSuggestions(res))
586-
pockect$.emptyInput().subscribe(() => store.clearSuggestions())
587-
588-
if (sub$) sub$.unsubscribe()
589-
sub$ = sr71$.data().subscribe($solver(DataSolver, ErrSolver))
590-
}
591-
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp