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
adb5bbbc
Commit
adb5bbbc
authored
Jun 16, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复光标兼容新的layout重构
parent
c21187a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
13 deletions
+37
-13
editor.js
src/module/editor.js
+37
-13
No files found.
src/module/editor.js
View file @
adb5bbbc
...
...
@@ -60,6 +60,7 @@ KityMinder.registerModule('TextEditModule', function() {
}
sel
.
setHide
();
var
node
=
e
.
getTargetNode
();
if
(
!
node
)
{
var
selectionShape
=
e
.
kityEvent
.
targetShape
;
if
(
selectionShape
&&
selectionShape
.
getType
()
==
'Selection'
)
{
...
...
@@ -74,7 +75,6 @@ KityMinder.registerModule('TextEditModule', function() {
if
(
node
)
{
var
textShape
=
node
.
getRenderer
(
'TextRenderer'
).
getRenderShape
();
textShape
.
setStyle
(
'cursor'
,
'default'
);
if
(
this
.
isSingleSelect
()
&&
node
.
isSelected
())
{
// && e.kityEvent.targetShape.getType().toLowerCase()== 'text'
sel
.
collapse
();
...
...
@@ -179,6 +179,7 @@ KityMinder.registerModule('TextEditModule', function() {
if
(
browser
.
ipad
)
{
receiver
.
container
.
focus
();
}
}
else
{
//当选中节点后,输入状态准备
var
node
=
e
.
getTargetNode
();
if
(
node
)
{
...
...
@@ -287,6 +288,9 @@ KityMinder.registerModule('TextEditModule', function() {
};
if
(
cmds
[
e
.
commandName
])
{
var
node
=
km
.
getSelectedNode
();
if
(
!
node
)
{
return
;
...
...
@@ -312,31 +316,51 @@ KityMinder.registerModule('TextEditModule', function() {
sel
.
setStartOffset
(
0
);
sel
.
setEndOffset
(
textShape
.
getContent
().
length
);
sel
.
setShow
();
receiver
.
updateSelectionShow
(
1
)
receiver
//.updateSelectionShow(1)
.
updateRange
(
range
);
sel
.
setHide
();
return
;
}
if
((
e
.
commandName
==
'priority'
||
e
.
commandName
==
'progress'
)
&&
this
.
getStatus
()
==
'textedit'
)
{
receiver
.
setBaseOffset
()
// if ((e.commandName == 'priority' || e.commandName == 'progress') && this.getStatus() == 'textedit') {
//
// sel.setHide();
// receiver.setBaseOffset()
// .getTextOffsetData();
////
//// if (sel.collapsed) {
//// receiver.updateSelection();
//// } else {
//// receiver.updateSelectionShow(1);
//// }
//
// return;
//
//
// }
receiver
.
clear
().
setTextEditStatus
(
false
);
if
(
this
.
getStatus
()
==
'textedit'
)
{
this
.
setStatus
(
'normal'
);
}
},
'layoutfinish'
:
function
(
e
){
if
(
e
.
node
===
receiver
.
minderNode
&&
this
.
getStatus
()
==
'textedit'
){
receiver
.
setBaseOffset
()
.
setContainerStyle
()
.
getTextOffsetData
();
if
(
sel
.
collapsed
)
{
receiver
.
updateSelection
();
}
else
{
receiver
.
updateSelectionShow
(
1
);
}
return
;
}
receiver
.
clear
().
setTextEditStatus
(
false
);
if
(
this
.
getStatus
()
==
'textedit'
)
{
this
.
setStatus
(
'normal'
);
sel
.
setShow
();
}
},
'selectionclear'
:
function
()
{
...
...
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