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
679bf01a
Commit
679bf01a
authored
Jan 13, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added highlight
parent
f965a887
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
minder.node.js
src/core/minder.node.js
+6
-1
minder.select.js
src/core/minder.select.js
+12
-1
layout.js
src/module/layout.js
+0
-1
No files found.
src/core/minder.node.js
View file @
679bf01a
...
...
@@ -44,7 +44,7 @@ kity.extendClass( Minder, {
stroke
:
"orange"
,
color
:
"black"
,
padding
:
[
5
,
10
,
5
,
10
],
fontSize
:
20
,
fontSize
:
20
};
var
kR
=
node
.
getRenderContainer
();
...
...
@@ -79,6 +79,11 @@ kity.extendClass( Minder, {
nodeShape
.
shape
.
setTransform
(
new
kity
.
Matrix
().
translate
(
node
.
getData
(
"x"
),
node
.
getData
(
"y"
)
-
_rectHeight
/
2
)
);
break
;
}
if
(
node
.
getData
(
"highlight"
)
)
{
nodeShape
.
highlight
();
}
else
{
nodeShape
.
unhighlight
();
}
},
renderNodes
:
function
(
nodes
)
{
var
km
=
this
;
...
...
src/core/minder.select.js
View file @
679bf01a
...
...
@@ -14,16 +14,21 @@ kity.extendClass( Minder, {
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
if
(
selection
.
indexOf
(
nodes
[
i
]
)
===
-
1
)
{
selection
.
push
(
nodes
[
i
]
);
this
.
highlightNode
(
nodes
[
i
]
);
}
}
return
this
;
},
highlightNode
:
function
(
node
)
{
node
.
setData
(
"highlight"
,
true
);
this
.
renderNode
(
node
);
},
isNodeSelected
:
function
(
node
)
{
return
!!~
this
.
_selectedNodes
.
indexOf
(
node
);
},
selectSingle
:
function
(
node
)
{
this
.
highlightNode
(
node
);
return
this
.
clearSelect
().
select
(
node
);
},
...
...
@@ -35,8 +40,10 @@ kity.extendClass( Minder, {
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
if
(
selection
.
indexOf
(
nodes
[
i
]
)
===
-
1
)
{
needAdd
.
push
(
nodes
[
i
]
);
this
.
highlightNode
(
nodes
[
i
]
);
}
else
{
needRemove
.
push
(
nodes
[
i
]
);
this
.
unhighlightNode
(
nodes
[
i
]
);
}
}
return
this
.
clearSelect
(
needRemove
).
select
(
needAdd
);
...
...
@@ -57,5 +64,9 @@ kity.extendClass( Minder, {
}
this
.
_selectedNodes
=
newSelection
;
return
this
;
},
unhighlightNode
:
function
(
node
)
{
node
.
setData
(
"highlight"
,
false
);
this
.
renderNode
(
node
);
}
}
);
\ No newline at end of file
src/module/layout.js
View file @
679bf01a
...
...
@@ -83,7 +83,6 @@ KityMinder.registerModule( "LayoutModule", function () {
};
var
createChildNode
=
function
(
km
,
parent
,
index
)
{
console
.
log
(
"cc"
);
var
root
=
km
.
getRoot
();
var
appendSide
=
parent
.
getData
(
"appendside"
);
var
_node
=
new
MinderNode
();
...
...
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