Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
b4238c81
Commit
b4238c81
authored
Feb 04, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
by zhanyi
parent
30e37603
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
33 deletions
+36
-33
editor.receiver.js
src/module/editor.receiver.js
+9
-6
keyboard.js
src/module/keyboard.js
+27
-27
No files found.
src/module/editor.receiver.js
View file @
b4238c81
...
...
@@ -82,14 +82,17 @@ Minder.Receiver = kity.createClass('Receiver',{
case
'beforekeyup'
:
if
(
this
.
isTextEditStatus
()){
if
(
keyCode
==
keymap
.
Enter
){
this
.
setTextEditStatus
(
false
);
this
.
clear
();
e
.
stopPropagation
();
return
;
switch
(
keyCode
){
case
keymap
.
Enter
:
case
keymap
.
Tab
:
this
.
setTextEditStatus
(
false
);
this
.
clear
();
e
.
stopPropagation
();
return
;
}
var
text
=
(
this
.
container
.
textContent
||
this
.
container
.
innerText
).
replace
(
/
\u
200b/g
,
''
);
this
.
textShape
.
setContent
(
text
);
this
.
setContainerStyle
();
...
...
src/module/keyboard.js
View file @
b4238c81
...
...
@@ -63,34 +63,34 @@ KityMinder.registerModule( "KeyboardModule", function () {
switch
(
e
.
originEvent
.
keyCode
)
{
case
keymap
.
Enter
:
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
'Topic'
)
);
e
.
preventDefault
();
break
;
case
keymap
.
Tab
:
this
.
execCommand
(
'appendChildNode'
,
new
MinderNode
(
'Topic'
)
);
e
.
preventDefault
();
break
;
case
keymap
.
Backspace
:
case
keymap
.
Del
:
this
.
execCommand
(
'removenode'
);
e
.
preventDefault
();
break
;
case
keymap
.
Enter
:
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
'Topic'
)
);
e
.
preventDefault
();
break
;
case
keymap
.
Tab
:
this
.
execCommand
(
'appendChildNode'
,
new
MinderNode
(
'Topic'
)
);
e
.
preventDefault
();
break
;
case
keymap
.
Backspace
:
case
keymap
.
Del
:
this
.
execCommand
(
'removenode'
);
e
.
preventDefault
();
break
;
case
keymap
.
Left
:
case
keymap
.
up
:
case
keymap
.
Right
:
case
keymap
.
Down
:
if
(
this
.
isSingleSelect
()
)
{
KBNavigate
(
this
,
{
37
:
'left'
,
38
:
'top'
,
39
:
'right'
,
40
:
'down'
}[
e
.
originEvent
.
keyCode
]
);
}
e
.
preventDefault
();
break
;
case
keymap
.
Left
:
case
keymap
.
up
:
case
keymap
.
Right
:
case
keymap
.
Down
:
if
(
this
.
isSingleSelect
()
)
{
KBNavigate
(
this
,
{
37
:
'left'
,
38
:
'top'
,
39
:
'right'
,
40
:
'down'
}[
e
.
originEvent
.
keyCode
]
);
}
e
.
preventDefault
();
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment