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',{
...
@@ -82,14 +82,17 @@ Minder.Receiver = kity.createClass('Receiver',{
case
'beforekeyup'
:
case
'beforekeyup'
:
if
(
this
.
isTextEditStatus
()){
if
(
this
.
isTextEditStatus
()){
switch
(
keyCode
){
if
(
keyCode
==
keymap
.
Enter
){
case
keymap
.
Enter
:
this
.
setTextEditStatus
(
false
);
case
keymap
.
Tab
:
this
.
clear
();
this
.
setTextEditStatus
(
false
);
e
.
stopPropagation
();
this
.
clear
();
return
;
e
.
stopPropagation
();
return
;
}
}
var
text
=
(
this
.
container
.
textContent
||
this
.
container
.
innerText
).
replace
(
/
\u
200b/g
,
''
);
var
text
=
(
this
.
container
.
textContent
||
this
.
container
.
innerText
).
replace
(
/
\u
200b/g
,
''
);
this
.
textShape
.
setContent
(
text
);
this
.
textShape
.
setContent
(
text
);
this
.
setContainerStyle
();
this
.
setContainerStyle
();
...
...
src/module/keyboard.js
View file @
b4238c81
...
@@ -63,34 +63,34 @@ KityMinder.registerModule( "KeyboardModule", function () {
...
@@ -63,34 +63,34 @@ KityMinder.registerModule( "KeyboardModule", function () {
switch
(
e
.
originEvent
.
keyCode
)
{
switch
(
e
.
originEvent
.
keyCode
)
{
case
keymap
.
Enter
:
case
keymap
.
Enter
:
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
'Topic'
)
);
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
'Topic'
)
);
e
.
preventDefault
();
e
.
preventDefault
();
break
;
break
;
case
keymap
.
Tab
:
case
keymap
.
Tab
:
this
.
execCommand
(
'appendChildNode'
,
new
MinderNode
(
'Topic'
)
);
this
.
execCommand
(
'appendChildNode'
,
new
MinderNode
(
'Topic'
)
);
e
.
preventDefault
();
e
.
preventDefault
();
break
;
break
;
case
keymap
.
Backspace
:
case
keymap
.
Backspace
:
case
keymap
.
Del
:
case
keymap
.
Del
:
this
.
execCommand
(
'removenode'
);
this
.
execCommand
(
'removenode'
);
e
.
preventDefault
();
e
.
preventDefault
();
break
;
break
;
case
keymap
.
Left
:
case
keymap
.
Left
:
case
keymap
.
up
:
case
keymap
.
up
:
case
keymap
.
Right
:
case
keymap
.
Right
:
case
keymap
.
Down
:
case
keymap
.
Down
:
if
(
this
.
isSingleSelect
()
)
{
if
(
this
.
isSingleSelect
()
)
{
KBNavigate
(
this
,
{
KBNavigate
(
this
,
{
37
:
'left'
,
37
:
'left'
,
38
:
'top'
,
38
:
'top'
,
39
:
'right'
,
39
:
'right'
,
40
:
'down'
40
:
'down'
}[
e
.
originEvent
.
keyCode
]
);
}[
e
.
originEvent
.
keyCode
]
);
}
}
e
.
preventDefault
();
e
.
preventDefault
();
break
;
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