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
2b1116d6
Commit
2b1116d6
authored
Jul 07, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://github.com/fex-team/kityminder
into dev
parents
f559c86b
a6616dfc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
editor.receiver.js
src/module/editor.receiver.js
+23
-2
No files found.
src/module/editor.receiver.js
View file @
2b1116d6
...
@@ -120,11 +120,14 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -120,11 +120,14 @@ Minder.Receiver = kity.createClass('Receiver', {
if
(
browser
.
gecko
&&
/
\s
$/
.
test
(
text
))
{
if
(
browser
.
gecko
&&
/
\s
$/
.
test
(
text
))
{
text
+=
'
\
u200b'
;
text
+=
'
\
u200b'
;
}
}
me
.
minderNode
.
setText
(
text
);
if
(
text
.
length
===
0
)
{
if
(
text
.
length
===
0
)
{
me
.
minderNode
.
setTmpData
(
'_lastTextContent'
,
me
.
textShape
.
getContent
());
me
.
minderNode
.
setText
(
'a'
);
me
.
minderNode
.
setText
(
'a'
);
}
else
{
me
.
minderNode
.
setText
(
text
);
}
}
me
.
setContainerStyle
();
me
.
setContainerStyle
();
me
.
minderNode
.
getRenderContainer
().
bringTop
();
me
.
minderNode
.
getRenderContainer
().
bringTop
();
me
.
minderNode
.
render
();
me
.
minderNode
.
render
();
...
@@ -149,7 +152,18 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -149,7 +152,18 @@ Minder.Receiver = kity.createClass('Receiver', {
me
.
selection
.
clearBaseOffset
();
me
.
selection
.
clearBaseOffset
();
}
}
function
restoreTextContent
(){
if
(
me
.
minderNode
){
var
textShape
=
me
.
minderNode
.
getTextShape
();
if
(
textShape
&&
textShape
.
getOpacity
()
===
0
){
me
.
minderNode
.
setText
(
me
.
minderNode
.
getTmpData
(
'_lastTextContent'
));
me
.
minderNode
.
render
();
me
.
minderNode
.
getTextShape
().
setOpacity
(
1
);
me
.
km
.
layout
(
300
);
}
}
}
switch
(
e
.
type
)
{
switch
(
e
.
type
)
{
case
'input'
:
case
'input'
:
...
@@ -162,6 +176,7 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -162,6 +176,7 @@ Minder.Receiver = kity.createClass('Receiver', {
case
'beforekeydown'
:
case
'beforekeydown'
:
this
.
isTypeText
=
keyCode
==
229
||
keyCode
===
0
;
this
.
isTypeText
=
keyCode
==
229
||
keyCode
===
0
;
switch
(
keyCode
)
{
switch
(
keyCode
)
{
case
keymap
.
Enter
:
case
keymap
.
Enter
:
case
keymap
.
Tab
:
case
keymap
.
Tab
:
...
@@ -174,12 +189,14 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -174,12 +189,14 @@ Minder.Receiver = kity.createClass('Receiver', {
this
.
km
.
setStatus
(
'normal'
);
this
.
km
.
setStatus
(
'normal'
);
this
.
km
.
fire
(
'contentchange'
);
this
.
km
.
fire
(
'contentchange'
);
}
}
restoreTextContent
();
return
;
return
;
case
keymap
.
left
:
case
keymap
.
left
:
case
keymap
.
right
:
case
keymap
.
right
:
case
keymap
.
up
:
case
keymap
.
up
:
case
keymap
.
down
:
case
keymap
.
down
:
if
(
this
.
selection
.
isHide
()){
if
(
this
.
selection
.
isHide
()){
restoreTextContent
();
this
.
km
.
setStatus
(
'normal'
);
this
.
km
.
setStatus
(
'normal'
);
return
;
return
;
}
}
...
@@ -198,6 +215,7 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -198,6 +215,7 @@ Minder.Receiver = kity.createClass('Receiver', {
}
}
//针对按住shift+方向键进行处理
//针对按住shift+方向键进行处理
if
(
orgEvt
.
shiftKey
&&
keymap
.
direction
[
keyCode
]
&&
this
.
selection
.
isShow
()){
if
(
orgEvt
.
shiftKey
&&
keymap
.
direction
[
keyCode
]
&&
this
.
selection
.
isShow
()){
if
(
this
.
selection
.
baseOffset
===
null
){
if
(
this
.
selection
.
baseOffset
===
null
){
this
.
selection
.
baseOffset
=
this
.
selection
.
startOffset
;
this
.
selection
.
baseOffset
=
this
.
selection
.
startOffset
;
...
@@ -238,6 +256,9 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -238,6 +256,9 @@ Minder.Receiver = kity.createClass('Receiver', {
this
.
updateSelectionShow
();
this
.
updateSelectionShow
();
e
.
preventDefault
();
e
.
preventDefault
();
return
;
return
;
}
else
if
(
keymap
.
direction
[
keyCode
]){
this
.
selection
.
baseOffset
=
this
.
selection
.
currentEndOffset
=
null
;
}
}
if
(
e
.
originEvent
.
ctrlKey
||
e
.
originEvent
.
metaKey
)
{
if
(
e
.
originEvent
.
ctrlKey
||
e
.
originEvent
.
metaKey
)
{
...
...
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