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
5e687016
Commit
5e687016
authored
Jan 23, 2015
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Animate support && text fix
parent
1926eda1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
6 deletions
+18
-6
animate.js
src/core/animate.js
+4
-0
node.js
src/module/node.js
+3
-6
text.js
src/module/text.js
+3
-0
view.js
src/module/view.js
+8
-0
No files found.
src/core/animate.js
View file @
5e687016
...
@@ -10,6 +10,7 @@ define(function(require, exports, module) {
...
@@ -10,6 +10,7 @@ define(function(require, exports, module) {
var
Minder
=
require
(
'./minder'
);
var
Minder
=
require
(
'./minder'
);
var
animateDefaultOptions
=
{
var
animateDefaultOptions
=
{
enableAnimation
:
true
,
layoutAnimationDuration
:
300
,
layoutAnimationDuration
:
300
,
viewAnimationDuration
:
100
,
viewAnimationDuration
:
100
,
zoomAnimationDuration
:
300
zoomAnimationDuration
:
300
...
@@ -18,6 +19,9 @@ define(function(require, exports, module) {
...
@@ -18,6 +19,9 @@ define(function(require, exports, module) {
Minder
.
registerInitHook
(
function
()
{
Minder
.
registerInitHook
(
function
()
{
this
.
setDefaultOptions
(
animateDefaultOptions
);
this
.
setDefaultOptions
(
animateDefaultOptions
);
if
(
!
this
.
getOption
(
'enableAnimation'
))
{
this
.
disableAnimation
();
}
});
});
Minder
.
prototype
.
enableAnimation
=
function
()
{
Minder
.
prototype
.
enableAnimation
=
function
()
{
...
...
src/module/node.js
View file @
5e687016
...
@@ -98,15 +98,11 @@ define(function(require, exports, module) {
...
@@ -98,15 +98,11 @@ define(function(require, exports, module) {
base
:
Command
,
base
:
Command
,
execute
:
function
(
km
,
text
)
{
execute
:
function
(
km
,
text
)
{
var
nodes
=
km
.
getSelectedNodes
();
var
nodes
=
km
.
getSelectedNodes
();
if
(
!
nodes
.
length
)
return
;
var
parent
=
nodes
[
0
].
parent
;
for
(
var
i
=
1
;
i
<
nodes
.
length
;
i
++
)
{
if
(
nodes
[
i
].
parent
!=
parent
)
return
-
1
;
}
nodes
.
sort
(
function
(
a
,
b
)
{
nodes
.
sort
(
function
(
a
,
b
)
{
return
a
.
getIndex
()
-
b
.
getIndex
();
return
a
.
getIndex
()
-
b
.
getIndex
();
});
});
var
parent
=
nodes
[
0
].
parent
;
var
newParent
=
km
.
createNode
(
text
,
parent
,
nodes
[
0
].
getIndex
());
var
newParent
=
km
.
createNode
(
text
,
parent
,
nodes
[
0
].
getIndex
());
nodes
.
forEach
(
function
(
node
)
{
nodes
.
forEach
(
function
(
node
)
{
...
@@ -121,6 +117,7 @@ define(function(require, exports, module) {
...
@@ -121,6 +117,7 @@ define(function(require, exports, module) {
var
nodes
=
km
.
getSelectedNodes
();
var
nodes
=
km
.
getSelectedNodes
();
if
(
!
nodes
.
length
)
return
;
if
(
!
nodes
.
length
)
return
;
var
parent
=
nodes
[
0
].
parent
;
var
parent
=
nodes
[
0
].
parent
;
if
(
!
parent
)
return
-
1
;
for
(
var
i
=
1
;
i
<
nodes
.
length
;
i
++
)
{
for
(
var
i
=
1
;
i
<
nodes
.
length
;
i
++
)
{
if
(
nodes
[
i
].
parent
!=
parent
)
return
-
1
;
if
(
nodes
[
i
].
parent
!=
parent
)
return
-
1
;
}
}
...
...
src/module/text.js
View file @
5e687016
...
@@ -74,6 +74,9 @@ define(function(require, exports, module) {
...
@@ -74,6 +74,9 @@ define(function(require, exports, module) {
for
(
i
=
0
,
text
,
textShape
;
for
(
i
=
0
,
text
,
textShape
;
(
text
=
textArr
[
i
],
textShape
=
textGroup
.
getItem
(
i
));
i
++
)
{
(
text
=
textArr
[
i
],
textShape
=
textGroup
.
getItem
(
i
));
i
++
)
{
textShape
.
setContent
(
text
);
textShape
.
setContent
(
text
);
if
(
kity
.
Browser
.
ie
)
{
textShape
.
fixPosition
();
}
}
}
this
.
setTextStyle
(
node
,
textGroup
);
this
.
setTextStyle
(
node
,
textGroup
);
...
...
src/module/view.js
View file @
5e687016
...
@@ -104,6 +104,8 @@ define(function(require, exports, module) {
...
@@ -104,6 +104,8 @@ define(function(require, exports, module) {
}
}
var
paper
=
dragger
.
_minder
.
getPaper
();
var
paper
=
dragger
.
_minder
.
getPaper
();
paper
.
setStyle
(
'cursor'
,
dragger
.
_minder
.
getStatus
()
==
'hand'
?
'-webkit-grab'
:
'default'
);
paper
.
setStyle
(
'cursor'
,
dragger
.
_minder
.
getStatus
()
==
'hand'
?
'-webkit-grab'
:
'default'
);
dragger
.
_minder
.
fire
(
'viewchanged'
);
}
}
this
.
_minder
.
on
(
'normal.mousedown normal.touchstart '
+
this
.
_minder
.
on
(
'normal.mousedown normal.touchstart '
+
...
@@ -296,6 +298,12 @@ define(function(require, exports, module) {
...
@@ -296,6 +298,12 @@ define(function(require, exports, module) {
y
:
dy
/
2.5
y
:
dy
/
2.5
});
});
var
me
=
this
;
clearTimeout
(
this
.
_mousewheeltimer
);
this
.
_mousewheeltimer
=
setTimeout
(
function
()
{
me
.
fire
(
'viewchanged'
);
},
100
);
e
.
preventDefault
();
e
.
preventDefault
();
},
},
'normal.dblclick readonly.dblclick'
:
function
(
e
)
{
'normal.dblclick readonly.dblclick'
:
function
(
e
)
{
...
...
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