Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of keyboard navigation for an empty lazy node #75

Merged
merged 1 commit into from
Oct 10, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/jquery.fancytree.js
Original file line number Diff line number Diff line change
Expand Up @@ -1921,14 +1921,14 @@ Fancytree.prototype = /**@lends Fancytree*/{
tree.nodeSetExpanded(ctx, true);
// tree.nodeSetFocus(ctx);
_goto(node);
} else if( node.children ) {
} else if( node.children && node.children.length ) {
// node.children[0].setFocus();
_goto(node.children[0]);
}
break;
case KC.UP:
sib = node.getPrevSibling();
while( sib && sib.expanded && sib.children ){
while( sib && sib.expanded && sib.children && sib.children.length ){
sib = sib.children[sib.children.length - 1];
}
if( !sib && node.parent && node.parent.parent ){
Expand All @@ -1937,7 +1937,7 @@ Fancytree.prototype = /**@lends Fancytree*/{
_goto(sib);
break;
case KC.DOWN:
if( node.expanded && node.children ) {
if( node.expanded && node.children && node.children.length ) {
sib = node.children[0];
} else {
parents = node.getParentList(false, true);
Expand Down