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
e7bca98e
Commit
e7bca98e
authored
Feb 17, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drop target effect
parent
ce6d6e6c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
6 deletions
+24
-6
minder.data.js
src/core/minder.data.js
+1
-1
dragtree.js
src/module/dragtree.js
+17
-3
select.js
src/module/select.js
+6
-2
No files found.
src/core/minder.data.js
View file @
e7bca98e
...
...
@@ -72,7 +72,7 @@ kity.extendClass( Minder, {
if
(
test
.
recognize
&&
test
.
recognize
(
local
)
)
{
protocal
=
test
;
}
return
!
test
;
return
!
protocal
;
}
);
}
...
...
src/module/dragtree.js
View file @
e7bca98e
...
...
@@ -105,6 +105,14 @@ function findAvailableParents( nodes, root ) {
return
availables
;
}
var
lastActivedDropTarget
=
null
;
function
activeDropTarget
(
node
)
{
if
(
lastActivedDropTarget
!=
node
)
{
node
.
getRenderContainer
().
fxScale
(
1.6
,
1.6
,
200
,
'ease'
).
fxScale
(
1
/
1.6
,
1
/
1.6
,
300
,
'ease'
);
lastActivedDropTarget
=
node
;
}
}
KityMinder
.
registerModule
(
"DragTree"
,
function
()
{
var
dragStartPosition
,
dragBox
,
dragTargets
,
dropTargets
,
dragTargetBoxes
,
dropTarget
;
...
...
@@ -147,13 +155,18 @@ KityMinder.registerModule( "DragTree", function () {
dragBox
.
blue
();
dropTarget
=
null
;
}
dropTargets
.
forEach
(
function
(
test
)
{
if
(
GM
.
isBoxIntersect
(
dragBox
.
getRenderBox
(),
test
.
getRenderContainer
().
getRenderBox
()
)
)
{
if
(
!
dropTarget
&&
GM
.
isBoxIntersect
(
dragBox
.
getRenderBox
(),
test
.
getRenderContainer
().
getRenderBox
()
)
)
{
activeDropTarget
(
test
);
//test.getRenderContainer().scale( 1.25 );
dropTarget
=
test
;
dragBox
.
green
();
}
}
);
if
(
!
dropTarget
)
{
lastActivedDropTarget
=
null
;
}
},
mouseup
:
function
(
e
)
{
dragStartPosition
=
null
;
...
...
@@ -161,12 +174,13 @@ KityMinder.registerModule( "DragTree", function () {
dragBox
.
remove
();
dragBox
=
null
;
if
(
dropTarget
)
{
dragTargets
.
forEach
(
function
(
target
)
{
for
(
var
i
=
dragTargets
.
length
-
1
,
target
;
i
>=
0
;
i
--
)
{
target
=
dragTargets
[
i
];
if
(
target
.
parent
)
{
target
.
parent
.
removeChild
(
target
);
dropTarget
.
appendChild
(
target
);
}
}
);
}
this
.
removeAllSelectedNodes
();
this
.
initStyle
(
this
.
getRoot
()
);
}
...
...
src/module/select.js
View file @
e7bca98e
...
...
@@ -73,6 +73,7 @@ KityMinder.registerModule( "Select", function () {
};
}
)();
var
singleSelectOnUp
=
null
;
return
{
"events"
:
{
mousedown
:
function
(
e
)
{
...
...
@@ -84,13 +85,16 @@ KityMinder.registerModule( "Select", function () {
this
.
toggleSelect
(
clickNode
);
}
else
if
(
!
clickNode
.
isSelected
()
)
{
this
.
select
(
clickNode
,
true
);
}
else
if
(
!
this
.
isSingleSelect
()
)
{
singleSelectOnUp
=
clickNode
;
}
},
mousemove
:
marqueeActivator
.
selectMove
,
mouseup
:
function
(
e
)
{
var
clickNode
=
e
.
getTargetNode
();
if
(
clickNode
&&
clickNode
.
isSelected
()
&&
!
this
.
isSingleSelect
()
)
{
this
.
select
(
clickNode
,
true
);
if
(
clickNode
&&
singleSelectOnUp
==
clickNode
)
{
this
.
select
(
singleSelectOnUp
,
true
);
singleSelectOnUp
=
null
;
}
marqueeActivator
.
selectEnd
(
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