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
7bd268cf
Commit
7bd268cf
authored
Jan 06, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev
parent
36320190
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
+11
-15
minder.command.js
src/core/minder.command.js
+3
-7
keyboard.js
src/module/keyboard.js
+8
-8
No files found.
src/core/minder.command.js
View file @
7bd268cf
...
@@ -81,13 +81,9 @@ kity.extendClass( Minder, {
...
@@ -81,13 +81,9 @@ kity.extendClass( Minder, {
if
(
!
stoped
)
{
if
(
!
stoped
)
{
this
.
_fire
(
new
MinderEvent
(
"precommand"
,
eventParams
,
false
)
);
this
.
_fire
(
new
MinderEvent
(
"precommand"
,
eventParams
,
false
)
);
try
{
result
=
command
.
execute
.
apply
(
command
,
[
me
].
concat
(
cmdArgs
)
);
result
=
command
.
execute
.
apply
(
command
,
[
me
].
concat
(
cmdArgs
)
);
}
catch
(
e
)
{
if
(
console
)
{
console
.
warn
(
'Command Exception: '
,
e
);
}
}
this
.
_fire
(
new
MinderEvent
(
"command"
,
eventParams
,
false
)
);
this
.
_fire
(
new
MinderEvent
(
"command"
,
eventParams
,
false
)
);
}
}
...
...
src/module/keyboard.js
View file @
7bd268cf
...
@@ -15,7 +15,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
...
@@ -15,7 +15,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
}
}
}
}
function
calcQuad
(
p
)
{
function
quadOf
(
p
)
{
return
p
.
x
>
0
?
return
p
.
x
>
0
?
(
p
.
y
>
0
?
1
:
2
)
:
(
p
.
y
>
0
?
1
:
2
)
:
(
p
.
y
<
0
?
3
:
4
);
(
p
.
y
<
0
?
3
:
4
);
...
@@ -30,7 +30,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
...
@@ -30,7 +30,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
for
(
var
i
=
0
;
i
<
pointIndexes
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
pointIndexes
.
length
;
i
++
)
{
if
(
i
==
iFind
)
continue
;
if
(
i
==
iFind
)
continue
;
current
=
matrix
.
transformPoint
(
pointIndexes
[
i
].
x
,
pointIndexes
[
i
].
y
);
current
=
matrix
.
transformPoint
(
pointIndexes
[
i
].
x
,
pointIndexes
[
i
].
y
);
quad
=
calcQuad
(
current
);
quad
=
quadOf
(
current
);
if
(
!
most
[
quad
]
||
current
.
length
()
<
most
[
quad
].
point
.
length
)
{
if
(
!
most
[
quad
]
||
current
.
length
()
<
most
[
quad
].
point
.
length
)
{
most
[
quad
]
=
{
most
[
quad
]
=
{
point
:
current
,
point
:
current
,
...
@@ -39,10 +39,10 @@ KityMinder.registerModule( "KeyboardModule", function () {
...
@@ -39,10 +39,10 @@ KityMinder.registerModule( "KeyboardModule", function () {
}
}
}
}
find
.
node
.
setData
(
'nearestNodes'
,
{
find
.
node
.
setData
(
'nearestNodes'
,
{
right
:
most
[
1
]
||
null
,
right
:
most
[
1
]
&&
most
[
1
].
node
||
null
,
top
:
most
[
2
]
||
null
,
top
:
most
[
2
]
&&
most
[
2
].
node
||
null
,
left
:
most
[
3
]
||
null
,
left
:
most
[
3
]
&&
most
[
3
].
node
||
null
,
down
:
most
[
4
]
||
null
down
:
most
[
4
]
&&
most
[
4
].
node
||
null
}
);
}
);
}
}
...
@@ -65,7 +65,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
...
@@ -65,7 +65,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
var
nextNode
=
referNode
.
getData
(
'nearestNodes'
)[
direction
];
var
nextNode
=
referNode
.
getData
(
'nearestNodes'
)[
direction
];
if
(
nextNode
)
{
if
(
nextNode
)
{
km
.
toggleSelect
(
[
referNode
,
nextNode
]
);
km
.
toggleSelect
(
[
referNode
,
nextNode
]
);
this
.
execCommand
(
'rendernode'
,
[
referNode
,
nextNode
]
);
km
.
execCommand
(
'rendernode'
,
[
referNode
,
nextNode
]
);
}
}
}
}
}
);
}
);
...
@@ -121,7 +121,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
...
@@ -121,7 +121,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
38
:
'top'
,
38
:
'top'
,
39
:
'right'
,
39
:
'right'
,
40
:
'down'
40
:
'down'
}[
e
.
keyCode
],
sNodes
[
0
]
);
}[
e
.
originEvent
.
keyCode
],
sNodes
[
0
]
);
}
}
break
;
break
;
}
}
...
...
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