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
2c4bd20a
Commit
2c4bd20a
authored
Jan 24, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了select功能
parent
1a6a1dce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
41 deletions
+39
-41
minder.select.js
src/core/minder.select.js
+4
-7
editor.js
src/module/editor.js
+33
-32
layout.js
src/module/layout.js
+2
-2
No files found.
src/core/minder.select.js
View file @
2c4bd20a
...
...
@@ -31,20 +31,17 @@ kity.extendClass( Minder, function () {
}
);
this
.
_selectedNodes
=
[];
},
select
:
function
(
nodes
)
{
this
.
removeAllSelectedNodes
();
select
:
function
(
nodes
,
isToggleSelect
)
{
isToggleSelect
&&
this
.
removeAllSelectedNodes
();
var
me
=
this
;
Utils
.
each
(
Utils
.
isArray
(
nodes
)
?
nodes
:
[
nodes
],
function
(
i
,
n
)
{
if
(
me
.
_selectedNodes
.
indexOf
(
n
)
!==
-
1
)
return
;
me
.
_selectedNodes
.
push
(
n
);
highlightNode
(
me
,
n
);
}
);
return
this
;
},
addSelect
:
function
(
node
)
{
var
me
=
this
;
if
(
me
.
_selectedNodes
.
indexOf
(
node
)
===
-
1
)
me
.
_selectedNodes
.
push
(
node
);
highlightNode
(
me
,
node
);
},
isNodeSelected
:
function
(
node
)
{
return
node
.
getData
(
'highlight'
)
===
true
;
},
...
...
src/module/editor.js
View file @
2c4bd20a
...
...
@@ -10,44 +10,45 @@ KityMinder.registerModule( "TextEditModule", function () {
this
.
getPaper
().
addShape
(
cursor
);
},
"events"
:
{
'aftermousedown'
:
function
(
e
){
if
(
this
.
isSingleSelect
()){
debugger
var
node
=
this
.
getSelectedNode
();
var
node_rc
=
node
.
getRenderContainer
();
var
position
=
e
.
getPosition
();
if
(
node_rc
.
getType
()
!=
'Text'
){
var
offset
=
e
.
getPosition
();
cursor
.
setShow
().
setPosition
(
offset
);
// receiver.clear()
// .setTextShape()
// .setTextShapeSize(cursor.height)
// .appendTextShapeToPaper(this.getPaper())
// .setPosition(position)
// .setRange(range,0)
// .setCursor(cursor)
receiver
.
setCursor
(
cursor
)
.
setKityMinder
(
this
)
.
setMinderNode
(
node
)
.
setTextShape
(
node_rc
)
.
setCursorHeight
()
.
setCurrentIndex
(
position
)
.
updateCursor
()
.
setRange
(
range
,
0
);
}
else
{
'beforemousedown'
:
function
(
e
){
//
// if(this.isSingleSelect()){
// console.log('isSelect')
// var node = this.getSelectedNode();
// var node_rc = node.getRenderContainer();
// var position = e.getPosition();
// if(node_rc.getType() != 'Text'){
// var offset = e.getPosition();
// cursor.setShow().setPosition(offset);
//// receiver.clear()
//// .setTextShape()
//// .setTextShapeSize(cursor.height)
//// .appendTextShapeToPaper(this.getPaper())
//// .setPosition(position)
//// .setRange(range,0)
//// .setCursor(cursor)
// receiver.setCursor(cursor)
// .setKityMinder(this)
// .setMinderNode(
e.getTargetNode()
)
// .setMinderNode(
node
)
// .setTextShape(node_rc)
// .setCursorHeight()
// .setCurrentIndex(position)
// .updateCursor()
// .setRange(range);
}
}
// .setRange(range,0);
// }else{
//
//
//// receiver.setCursor(cursor)
//// .setKityMinder(this)
//// .setMinderNode(e.getTargetNode())
//// .setTextShape(node_rc)
//// .setCursorHeight()
//// .setCurrentIndex(position)
//// .updateCursor()
//// .setRange(range);
//
// }
// }
}
}
...
...
src/module/layout.js
View file @
2c4bd20a
...
...
@@ -85,7 +85,7 @@ KityMinder.registerModule( "LayoutModule", function () {
execute
:
function
(
km
,
node
)
{
var
parent
=
km
.
getSelectedNode
();
km
.
appendChildNode
(
parent
,
node
);
km
.
select
(
node
);
km
.
select
(
node
,
true
);
return
node
;
}
};
...
...
@@ -100,7 +100,7 @@ KityMinder.registerModule( "LayoutModule", function () {
}
else
{
km
.
appendSiblingNode
(
selectedNode
,
node
);
}
km
.
select
(
node
);
km
.
select
(
node
,
true
);
return
node
;
}
};
...
...
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