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
fc1feab1
Commit
fc1feab1
authored
Jun 12, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实验拖动功能
parent
7eeea30b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
layout.js
src/core/layout.js
+8
-0
default.js
src/layout/default.js
+1
-1
dragtree.js
src/module/dragtree.js
+5
-5
No files found.
src/core/layout.js
View file @
fc1feab1
...
@@ -105,6 +105,7 @@ kity.extendClass(MinderNode, {
...
@@ -105,6 +105,7 @@ kity.extendClass(MinderNode, {
x
:
p
.
x
,
x
:
p
.
x
,
y
:
p
.
y
y
:
p
.
y
});
});
return
this
;
},
},
getLayoutRoot
:
function
()
{
getLayoutRoot
:
function
()
{
...
@@ -130,6 +131,10 @@ kity.extendClass(MinderNode, {
...
@@ -130,6 +131,10 @@ kity.extendClass(MinderNode, {
this
.
getMinder
().
layout
(
duration
);
this
.
getMinder
().
layout
(
duration
);
return
this
;
return
this
;
},
getPositionContext
:
function
(
node
,
position
)
{
}
}
});
});
...
@@ -167,6 +172,9 @@ kity.extendClass(Minder, {
...
@@ -167,6 +172,9 @@ kity.extendClass(Minder, {
var
matrix
=
node
.
getLayoutTransform
().
merge
(
pMatrix
);
var
matrix
=
node
.
getLayoutTransform
().
merge
(
pMatrix
);
var
lastMatrix
=
node
.
_lastLayoutTransform
||
new
kity
.
Matrix
();
var
lastMatrix
=
node
.
_lastLayoutTransform
||
new
kity
.
Matrix
();
var
offset
=
node
.
getLayoutOffset
();
matrix
.
translate
(
offset
.
x
,
offset
.
y
);
if
(
!
matrix
.
equals
(
lastMatrix
)
||
true
)
{
if
(
!
matrix
.
equals
(
lastMatrix
)
||
true
)
{
// 如果当前有动画,停止动画
// 如果当前有动画,停止动画
...
...
src/layout/default.js
View file @
fc1feab1
...
@@ -158,7 +158,7 @@ KityMinder.registerConnectProvider('default', function(node, parent, connection)
...
@@ -158,7 +158,7 @@ KityMinder.registerConnectProvider('default', function(node, parent, connection)
end
=
new
kity
.
Point
(
box
.
left
-
node
.
getStyle
(
'margin-left'
),
box
.
bottom
);
end
=
new
kity
.
Point
(
box
.
left
-
node
.
getStyle
(
'margin-left'
),
box
.
bottom
);
}
}
end
.
y
+=
1
;
end
.
y
+=
3
;
var
isTop
=
parent
.
children
.
length
>
1
&&
node
.
getIndex
()
===
0
;
var
isTop
=
parent
.
children
.
length
>
1
&&
node
.
getIndex
()
===
0
;
...
...
src/module/dragtree.js
View file @
fc1feab1
...
@@ -234,11 +234,11 @@ var DragBox = kity.createClass('DragBox', {
...
@@ -234,11 +234,11 @@ var DragBox = kity.createClass('DragBox', {
}
}
var
movement
=
kity
.
Vector
.
fromPoints
(
this
.
_startPosition
,
this
.
_dragPosition
);
var
movement
=
kity
.
Vector
.
fromPoints
(
this
.
_startPosition
,
this
.
_dragPosition
);
//
var minder = this._minder;
var
minder
=
this
.
_minder
;
//
this._dragSources.forEach(function(source) {
this
.
_dragSources
.
forEach
(
function
(
source
)
{
//
source.setLayoutOffset(movement);
source
.
setLayoutOffset
(
movement
);
//
minder.layout();
minder
.
layout
();
//
});
});
this
.
setTranslate
(
movement
);
this
.
setTranslate
(
movement
);
...
...
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