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
d17305ff
Commit
d17305ff
authored
Feb 12, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed select bug
parent
158f30b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
31 deletions
+32
-31
keyboard.js
src/module/keyboard.js
+27
-29
layout.js
src/module/layout.js
+5
-2
No files found.
src/module/keyboard.js
View file @
d17305ff
...
@@ -60,37 +60,35 @@ KityMinder.registerModule( "KeyboardModule", function () {
...
@@ -60,37 +60,35 @@ KityMinder.registerModule( "KeyboardModule", function () {
buildPositionNetwork
(
this
.
getRoot
()
);
buildPositionNetwork
(
this
.
getRoot
()
);
},
},
keydown
:
function
(
e
)
{
keydown
:
function
(
e
)
{
switch
(
e
.
originEvent
.
keyCode
)
{
switch
(
e
.
originEvent
.
keyCode
)
{
case
keymap
.
Enter
:
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
'Topic'
)
);
e
.
preventDefault
();
break
;
case
keymap
.
Tab
:
this
.
execCommand
(
'appendChildNode'
,
new
MinderNode
(
'Topic'
)
);
e
.
preventDefault
();
break
;
case
keymap
.
Backspace
:
case
keymap
.
Del
:
this
.
execCommand
(
'removenode'
);
e
.
preventDefault
();
break
;
case
keymap
.
Enter
:
case
keymap
.
Left
:
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
'Topic'
)
);
case
keymap
.
up
:
e
.
preventDefault
();
case
keymap
.
Right
:
break
;
case
keymap
.
Down
:
case
keymap
.
Tab
:
if
(
this
.
isSingleSelect
()
)
{
this
.
execCommand
(
'appendChildNode'
,
new
MinderNode
(
'Topic'
)
);
KBNavigate
(
this
,
{
e
.
preventDefault
();
37
:
'left'
,
break
;
38
:
'top'
,
case
keymap
.
Backspace
:
39
:
'right'
,
case
keymap
.
Del
:
40
:
'down'
this
.
execCommand
(
'removenode'
);
}[
e
.
originEvent
.
keyCode
]
);
e
.
preventDefault
();
}
break
;
e
.
preventDefault
();
break
;
case
keymap
.
Left
:
case
keymap
.
up
:
case
keymap
.
Right
:
case
keymap
.
Down
:
if
(
this
.
isSingleSelect
()
)
{
KBNavigate
(
this
,
{
37
:
'left'
,
38
:
'top'
,
39
:
'right'
,
40
:
'down'
}[
e
.
originEvent
.
keyCode
]
);
}
e
.
preventDefault
();
break
;
}
}
}
}
...
...
src/module/layout.js
View file @
d17305ff
...
@@ -131,11 +131,11 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -131,11 +131,11 @@ KityMinder.registerModule( "LayoutModule", function () {
for
(
var
i
=
0
;
i
<
selectedNodes
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
selectedNodes
.
length
;
i
++
)
{
_buffer
.
push
(
selectedNodes
[
i
]
);
_buffer
.
push
(
selectedNodes
[
i
]
);
}
}
while
(
_buffer
.
length
!==
1
)
{
do
{
var
parent
=
_buffer
[
0
].
getParent
();
var
parent
=
_buffer
[
0
].
getParent
();
if
(
parent
&&
_buffer
.
indexOf
(
parent
)
===
-
1
)
_buffer
.
push
(
parent
);
if
(
parent
&&
_buffer
.
indexOf
(
parent
)
===
-
1
)
_buffer
.
push
(
parent
);
_buffer
.
shift
();
_buffer
.
shift
();
}
}
while
(
_buffer
.
length
!==
1
);
km
.
removeNode
(
selectedNodes
);
km
.
removeNode
(
selectedNodes
);
km
.
select
(
_buffer
[
0
]
);
km
.
select
(
_buffer
[
0
]
);
}
}
...
@@ -153,6 +153,9 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -153,6 +153,9 @@ KityMinder.registerModule( "LayoutModule", function () {
"ready"
:
function
()
{
"ready"
:
function
()
{
this
.
setDefaultOptions
(
'layoutstyle'
,
this
.
getLayoutStyleItems
()
);
this
.
setDefaultOptions
(
'layoutstyle'
,
this
.
getLayoutStyleItems
()
);
switchLayout
(
this
,
this
.
getOptions
(
'defaultlayoutstyle'
)
);
switchLayout
(
this
,
this
.
getOptions
(
'defaultlayoutstyle'
)
);
},
"click"
:
function
(
e
)
{
}
}
},
},
"defaultOptions"
:
{
"defaultOptions"
:
{
...
...
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