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
49035271
Commit
49035271
authored
Feb 13, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://github.com/kitygraph/kityminder
into dev
parents
a4b3a6f8
741c25b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
editor.js
src/module/editor.js
+5
-1
editor.receiver.js
src/module/editor.receiver.js
+3
-1
keyboard.js
src/module/keyboard.js
+17
-0
No files found.
src/module/editor.js
View file @
49035271
...
...
@@ -3,7 +3,7 @@ KityMinder.registerModule( "TextEditModule", function () {
var
receiver
=
new
Minder
.
Receiver
(
this
);
var
range
=
new
Minder
.
Range
();
this
.
receiver
=
receiver
;
return
{
//插入光标
"init"
:
function
(){
...
...
@@ -34,6 +34,10 @@ KityMinder.registerModule( "TextEditModule", function () {
},
'restoreScene'
:
function
(){
cursor
.
setHide
();
},
'stopTextEdit'
:
function
(){
cursor
.
setHide
();
}
}
};
...
...
src/module/editor.receiver.js
View file @
49035271
...
...
@@ -79,7 +79,7 @@ Minder.Receiver = kity.createClass('Receiver',{
case
keymap
.
Tab
:
this
.
setTextEditStatus
(
false
);
this
.
clear
();
e
.
stopPropagation
();
e
.
preventDefault
();
return
;
case
keymap
.
Shift
:
case
keymap
.
Control
:
...
...
@@ -90,9 +90,11 @@ Minder.Receiver = kity.createClass('Receiver',{
}
var
text
=
(
this
.
container
.
textContent
||
this
.
container
.
innerText
).
replace
(
/
\u
200b/g
,
''
);
this
.
textShape
.
setContent
(
text
);
this
.
setContainerStyle
();
this
.
minderNode
.
setText
(
text
);
this
.
km
.
updateLayout
(
this
.
minderNode
);
this
.
setBaseOffset
();
this
.
updateTextData
();
...
...
src/module/keyboard.js
View file @
49035271
...
...
@@ -62,6 +62,23 @@ KityMinder.registerModule( "KeyboardModule", function () {
},
keydown
:
function
(
e
)
{
var
keys
=
KityMinder
.
keymap
;
if
(
this
.
receiver
.
isTextEditStatus
()){
switch
(
e
.
originEvent
.
keyCode
)
{
case
keys
.
Enter
:
case
keys
.
Tab
:
this
.
fire
(
'stopTextEdit'
);
e
.
preventDefault
();
break
;
case
keys
.
Backspace
:
case
keys
.
Del
:
case
keys
.
Left
:
case
keys
.
Up
:
case
keys
.
Right
:
case
keys
.
Down
:
break
;
}
return
;
}
switch
(
e
.
originEvent
.
keyCode
)
{
case
keys
.
Enter
:
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
'Topic'
)
);
...
...
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