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
201b0f5e
Commit
201b0f5e
authored
Oct 11, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改进选中节点时,如果输入文字,节点内容会被先选中的问题
parent
e8b42350
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
editor.keyboard.js
src/module/editor.keyboard.js
+9
-3
editor.range.js
src/module/editor.range.js
+6
-1
No files found.
src/module/editor.keyboard.js
View file @
201b0f5e
...
@@ -95,7 +95,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
...
@@ -95,7 +95,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
me
.
inputTextTimer
=
setTimeout
(
function
(){
me
.
inputTextTimer
=
setTimeout
(
function
(){
me
.
km
.
layout
(
300
);
me
.
km
.
layout
(
300
);
},
25
0
);
},
30
0
);
}
}
me
.
re
.
updateTextOffsetData
()
me
.
re
.
updateTextOffsetData
()
...
@@ -104,8 +104,13 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
...
@@ -104,8 +104,13 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
me
.
selection
me
.
selection
.
updateOffsetByTextData
(
me
.
re
.
textData
)
.
updateOffsetByTextData
(
me
.
re
.
textData
)
.
updatePosition
()
.
updatePosition
();
.
setHoldShow
();
//当然inputready状态时,如果输入文字,节点内文本会被先选中然后再消失,体验不好
if
(
me
.
km
.
getStatus
()
!=
'inputready'
){
me
.
selection
.
setHoldShow
();
}
me
.
timer
=
setTimeout
(
function
()
{
me
.
timer
=
setTimeout
(
function
()
{
...
@@ -232,6 +237,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
...
@@ -232,6 +237,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
//针对不能连续删除做处理
//针对不能连续删除做处理
//if(keymap.Del == keyCode || keymap.Backspace == keyCode)
//if(keymap.Del == keyCode || keymap.Backspace == keyCode)
// me._setTextToContainer(keyCode);
// me._setTextToContainer(keyCode);
me
.
_setTextToContainer
(
keyCode
);
me
.
_setTextToContainer
(
keyCode
);
},
},
_beforeKeyup
:
function
(
e
){
_beforeKeyup
:
function
(
e
){
...
...
src/module/editor.range.js
View file @
201b0f5e
...
@@ -7,7 +7,12 @@ Minder.Range = kity.createClass('Range',function(){
...
@@ -7,7 +7,12 @@ Minder.Range = kity.createClass('Range',function(){
if
(
node
.
nodeType
==
1
){
if
(
node
.
nodeType
==
1
){
//默认不会出现得不到子节点的情况
//默认不会出现得不到子节点的情况
node
=
node
.
childNodes
[
offset
];
node
=
node
.
childNodes
[
offset
];
if
(
node
.
nodeType
==
3
){
if
(
!
node
&&
rng
.
startContainer
&&
rng
.
startContainer
.
nodeName
==
'DIV'
)
{
rng
.
startContainer
.
innerHTML
=
'<p></p>'
;
offset
=
0
;
}
else
if
(
node
.
nodeType
==
3
){
offset
=
0
;
offset
=
0
;
}
}
}
}
...
...
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