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
2bf0eab8
Commit
2bf0eab8
authored
May 02, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recover icon func
parent
43a50557
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
43 deletions
+19
-43
icon.js
src/module/icon.js
+18
-24
layout.default.js
src/module/layout.default.js
+1
-19
No files found.
src/module/icon.js
View file @
2bf0eab8
...
@@ -5,11 +5,15 @@ KityMinder.registerModule( "IconModule", function () {
...
@@ -5,11 +5,15 @@ KityMinder.registerModule( "IconModule", function () {
var
_number
=
new
kity
.
Text
().
setContent
(
val
).
fill
(
"white"
).
setSize
(
12
);
var
_number
=
new
kity
.
Text
().
setContent
(
val
).
fill
(
"white"
).
setSize
(
12
);
var
_rc
=
new
kity
.
Group
();
var
_rc
=
new
kity
.
Group
();
_rc
.
addShapes
(
[
_bg
,
_number
]
);
_rc
.
addShapes
(
[
_bg
,
_number
]
);
node
.
get
Icon
Rc
().
addShape
(
_rc
);
node
.
get
Cont
Rc
().
addShape
(
_rc
);
_number
.
setTransform
(
new
kity
.
Matrix
().
translate
(
6
,
15
)
);
_number
.
setTransform
(
new
kity
.
Matrix
().
translate
(
6
,
15
)
);
var
rcHeight
=
_rc
.
getHeight
();
_rc
.
setTransform
(
new
kity
.
Matrix
().
translate
(
0
,
-
rcHeight
/
2
)
);
};
};
var
renderProgressIcon
=
function
(
node
,
val
,
left
)
{
var
renderProgressIcon
=
function
(
node
,
val
)
{
var
_rc
=
new
kity
.
Group
();
var
_rc
=
new
kity
.
Group
();
var
_contRc
=
node
.
getContRc
();
var
_bg
=
new
kity
.
Circle
().
setRadius
(
8
).
fill
(
"white"
).
stroke
(
new
kity
.
Pen
(
"#29A6BD"
,
2
)
);
var
_bg
=
new
kity
.
Circle
().
setRadius
(
8
).
fill
(
"white"
).
stroke
(
new
kity
.
Pen
(
"#29A6BD"
,
2
)
);
var
_percent
,
d
;
var
_percent
,
d
;
if
(
val
<
5
)
{
if
(
val
<
5
)
{
...
@@ -18,8 +22,7 @@ KityMinder.registerModule( "IconModule", function () {
...
@@ -18,8 +22,7 @@ KityMinder.registerModule( "IconModule", function () {
d
.
moveTo
(
0
,
0
).
lineTo
(
6
,
0
);
d
.
moveTo
(
0
,
0
).
lineTo
(
6
,
0
);
}
else
_percent
=
new
kity
.
Group
();
}
else
_percent
=
new
kity
.
Group
();
_rc
.
addShapes
(
[
_bg
,
_percent
]
);
_rc
.
addShapes
(
[
_bg
,
_percent
]
);
node
.
getIconRc
().
addShape
(
_rc
);
_contRc
.
addShape
(
_rc
);
_rc
.
setTransform
(
new
kity
.
Matrix
().
translate
(
left
,
10
)
);
switch
(
val
)
{
switch
(
val
)
{
case
1
:
case
1
:
break
;
break
;
...
@@ -41,6 +44,7 @@ KityMinder.registerModule( "IconModule", function () {
...
@@ -41,6 +44,7 @@ KityMinder.registerModule( "IconModule", function () {
}
}
if
(
val
<
5
)
d
.
close
();
if
(
val
<
5
)
d
.
close
();
_percent
.
fill
(
"#29A6BD"
);
_percent
.
fill
(
"#29A6BD"
);
_rc
.
setTransform
(
new
kity
.
Matrix
().
translate
(
_contRc
.
getWidth
()
+
5
,
0
)
);
};
};
var
setPriorityCommand
=
kity
.
createClass
(
"SetPriorityCommand"
,
(
function
()
{
var
setPriorityCommand
=
kity
.
createClass
(
"SetPriorityCommand"
,
(
function
()
{
return
{
return
{
...
@@ -91,26 +95,16 @@ KityMinder.registerModule( "IconModule", function () {
...
@@ -91,26 +95,16 @@ KityMinder.registerModule( "IconModule", function () {
},
},
"events"
:
{
"events"
:
{
"RenderNodeLeft"
:
function
(
e
)
{
"RenderNodeLeft"
:
function
(
e
)
{
// var node = e.node;
var
node
=
e
.
node
;
// var iconRc = new kity.Group();
var
PriorityIconVal
=
node
.
getData
(
"PriorityIcon"
);
// var contRc = node.getContRc();
var
ProgressIconVal
=
node
.
getData
(
"ProgressIcon"
);
// var PriorityIconVal = node.getData( "PriorityIcon" );
var
contRc
=
node
.
getContRc
();
// var ProgressIconVal = node.getData( "ProgressIcon" );
if
(
PriorityIconVal
)
{
// //依次排布图标、文字
renderPriorityIcon
(
node
,
PriorityIconVal
);
// //iconRc.clear();
}
// var PriorityIconWidth = 0;
if
(
ProgressIconVal
)
{
// if ( PriorityIconVal ) {
renderProgressIcon
(
node
,
ProgressIconVal
);
// renderPriorityIcon( node, PriorityIconVal );
}
// PriorityIconWidth = 22;
// }
// if ( ProgressIconVal ) {
// renderProgressIcon( node, ProgressIconVal, PriorityIconWidth + 10 );
// }
// var iconWidth = iconRc.getWidth();
// //var textShape = node.getTextShape();
// //if ( iconWidth ) textShape.setTransform( new kity.Matrix().translate( iconWidth + 5, 0 ) );
// //else textShape.setTransform( new kity.Matrix().translate( 0, 0 ) );
// iconRc.setTransform( new kity.Matrix().translate( 0, -( iconRc.getHeight() + textShape.getHeight() ) / 2 ) );
}
}
}
}
};
};
...
...
src/module/layout.default.js
View file @
2bf0eab8
...
@@ -514,19 +514,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -514,19 +514,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
if
(
historyPoint
)
{
if
(
historyPoint
)
{
_root
.
setPoint
(
historyPoint
);
_root
.
setPoint
(
historyPoint
);
}
}
// var j = 0;
// var me = this;
// var ITV = window.setInterval( function () {
// for ( var k = 0; k < 0; k++ ) {
// me.appendChildNode( _cleanbuffer[ j ].getLayout().parent, _cleanbuffer[ j ] );
// j++;
// if ( j === _cleanbuffer.length ) break;
// }
// if ( j === _cleanbuffer.length ) {
// window.clearInterval( ITV );
// }
// }, 0 );
//重组结构
for
(
var
j
=
0
;
j
<
_cleanbuffer
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
_cleanbuffer
.
length
;
j
++
)
{
this
.
appendChildNode
(
_cleanbuffer
[
j
].
getLayout
().
parent
,
_cleanbuffer
[
j
]
);
this
.
appendChildNode
(
_cleanbuffer
[
j
].
getLayout
().
parent
,
_cleanbuffer
[
j
]
);
}
}
...
@@ -544,6 +531,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -544,6 +531,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
Layout
.
appendside
=
siblingLayout
.
appendside
;
Layout
.
appendside
=
siblingLayout
.
appendside
;
Layout
.
align
=
siblingLayout
.
align
;
Layout
.
align
=
siblingLayout
.
align
;
if
(
parent
.
getType
()
===
"root"
)
{
if
(
parent
.
getType
()
===
"root"
)
{
minder
.
handelNodeInsert
(
node
);
var
len
=
parent
.
getChildren
().
length
;
var
len
=
parent
.
getChildren
().
length
;
if
(
len
<
7
)
{
if
(
len
<
7
)
{
if
(
len
%
2
)
{
if
(
len
%
2
)
{
...
@@ -603,12 +591,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -603,12 +591,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
//计算位置等流程
//计算位置等流程
updateBg
(
node
);
updateBg
(
node
);
initLayout
(
node
);
initLayout
(
node
);
// this._fire( new MinderEvent( "beforeRenderNode", {
// node: node
// }, false ) );
// this._fire( new MinderEvent( "RenderNode", {
// node: node
// }, false ) );
this
.
_firePharse
(
new
MinderEvent
(
"RenderNodeLeft"
,
{
this
.
_firePharse
(
new
MinderEvent
(
"RenderNodeLeft"
,
{
node
:
node
node
:
node
},
false
)
);
},
false
)
);
...
...
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