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
4aefee2f
Commit
4aefee2f
authored
Jul 24, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix shift + tab issue
parent
431d53b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
layout.js
src/core/layout.js
+9
-1
expand.js
src/module/expand.js
+1
-3
keyboard.js
src/module/keyboard.js
+9
-2
No files found.
src/core/layout.js
View file @
4aefee2f
...
@@ -200,9 +200,14 @@ kity.extendClass(Minder, {
...
@@ -200,9 +200,14 @@ kity.extendClass(Minder, {
applyLayoutResult
:
function
(
root
,
duration
)
{
applyLayoutResult
:
function
(
root
,
duration
)
{
root
=
root
||
this
.
getRoot
();
root
=
root
||
this
.
getRoot
();
var
me
=
this
;
var
me
=
this
;
var
complex
=
root
.
getComplex
();
function
consume
()
{
if
(
!--
complex
)
me
.
fire
(
'layoutallfinish'
);
}
// 节点复杂度大于 100,关闭动画
// 节点复杂度大于 100,关闭动画
if
(
root
.
getComplex
()
>
300
)
duration
=
0
;
if
(
complex
>
300
)
duration
=
0
;
function
applyMatrix
(
node
,
matrix
)
{
function
applyMatrix
(
node
,
matrix
)
{
node
.
getRenderContainer
().
setMatrix
(
node
.
_lastLayoutTransform
=
matrix
);
node
.
getRenderContainer
().
setMatrix
(
node
.
_lastLayoutTransform
=
matrix
);
...
@@ -242,6 +247,7 @@ kity.extendClass(Minder, {
...
@@ -242,6 +247,7 @@ kity.extendClass(Minder, {
node
:
node
,
node
:
node
,
matrix
:
matrix
matrix
:
matrix
});
});
consume
();
});
});
});
});
}
}
...
@@ -253,6 +259,7 @@ kity.extendClass(Minder, {
...
@@ -253,6 +259,7 @@ kity.extendClass(Minder, {
node
:
node
,
node
:
node
,
matrix
:
matrix
matrix
:
matrix
});
});
consume
();
}
}
}
else
{
}
else
{
// 可能位置没有改变,但是相关布局变量变了
// 可能位置没有改变,但是相关布局变量变了
...
@@ -264,6 +271,7 @@ kity.extendClass(Minder, {
...
@@ -264,6 +271,7 @@ kity.extendClass(Minder, {
node
:
node
,
node
:
node
,
matrix
:
matrix
matrix
:
matrix
});
});
consume
();
}
}
for
(
var
i
=
0
;
i
<
node
.
children
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
node
.
children
.
length
;
i
++
)
{
...
...
src/module/expand.js
View file @
4aefee2f
...
@@ -72,9 +72,7 @@ KityMinder.registerModule('Expand', function() {
...
@@ -72,9 +72,7 @@ KityMinder.registerModule('Expand', function() {
function
setExpandState
(
node
,
state
,
policy
)
{
function
setExpandState
(
node
,
state
,
policy
)
{
policy
=
policy
||
EXPAND_POLICY
.
KEEP_STATE
;
policy
=
policy
||
EXPAND_POLICY
.
KEEP_STATE
;
policy
(
node
,
state
,
policy
);
policy
(
node
,
state
,
policy
);
node
.
traverse
(
function
(
node
)
{
node
.
renderTree
();
node
.
render
();
});
node
.
getMinder
().
layout
(
100
);
node
.
getMinder
().
layout
(
100
);
}
}
...
...
src/module/keyboard.js
View file @
4aefee2f
...
@@ -130,7 +130,7 @@ KityMinder.registerModule('KeyboardModule', function() {
...
@@ -130,7 +130,7 @@ KityMinder.registerModule('KeyboardModule', function() {
var
lastFrame
;
var
lastFrame
;
return
{
return
{
'events'
:
{
'events'
:
{
'layoutfinish'
:
function
()
{
'layout
all
finish'
:
function
()
{
var
root
=
this
.
getRoot
();
var
root
=
this
.
getRoot
();
function
build
()
{
function
build
()
{
buildPositionNetwork
(
root
);
buildPositionNetwork
(
root
);
...
@@ -138,6 +138,10 @@ KityMinder.registerModule('KeyboardModule', function() {
...
@@ -138,6 +138,10 @@ KityMinder.registerModule('KeyboardModule', function() {
kity
.
Timeline
.
releaseFrame
(
lastFrame
);
kity
.
Timeline
.
releaseFrame
(
lastFrame
);
lastFrame
=
kity
.
Timeline
.
requestFrame
(
build
);
lastFrame
=
kity
.
Timeline
.
requestFrame
(
build
);
},
},
'inputready.beforekeydown'
:
function
(
e
)
{
var
keyEvent
=
e
.
originEvent
;
if
(
keyEvent
.
shiftKey
&&
keyEvent
.
keyCode
==
KityMinder
.
keymap
.
Tab
)
e
.
preventDefault
();
},
'normal.keydown'
:
function
(
e
)
{
'normal.keydown'
:
function
(
e
)
{
var
keys
=
KityMinder
.
keymap
;
var
keys
=
KityMinder
.
keymap
;
...
@@ -148,7 +152,10 @@ KityMinder.registerModule('KeyboardModule', function() {
...
@@ -148,7 +152,10 @@ KityMinder.registerModule('KeyboardModule', function() {
var
keyEvent
=
e
.
originEvent
;
var
keyEvent
=
e
.
originEvent
;
if
(
keyEvent
.
altKey
||
keyEvent
.
ctrlKey
||
keyEvent
.
metaKey
||
keyEvent
.
shiftKey
)
return
;
if
(
keyEvent
.
altKey
||
keyEvent
.
ctrlKey
||
keyEvent
.
metaKey
||
keyEvent
.
shiftKey
)
{
if
([
keys
.
Tab
].
indexOf
(
keyEvent
.
keyCode
))
e
.
preventDefault
;
return
;
}
switch
(
keyEvent
.
keyCode
)
{
switch
(
keyEvent
.
keyCode
)
{
case
keys
.
Enter
:
case
keys
.
Enter
:
...
...
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