Skip to content

Commit

Permalink
fixed error when rules plugin is included but not used
Browse files Browse the repository at this point in the history
  • Loading branch information
vakata committed Jun 1, 2012
1 parent e6c2762 commit 37a247a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dist/jstree.js
Expand Up @@ -4859,9 +4859,9 @@ Sorts items alphabetically (or using any other function)
obj = obj.data('jstree');
return {
'type' : false,
'max_depth' : obj.max_depth || -1,
'max_children' : obj.max_children || -1,
'valid_children' : obj.valid_children || -1
'max_depth' : obj && obj.max_depth ? obj.max_depth : -1,
'max_children' : obj && obj.max_children ? obj.max_children : -1,
'valid_children' : obj && obj.valid_children ? obj.valid_children : -1
};
}
if(!obj || !obj.length) { return false; }
Expand Down
2 changes: 1 addition & 1 deletion dist/jstree.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/jstree.rules.js
Expand Up @@ -22,9 +22,9 @@ Sorts items alphabetically (or using any other function)
obj = obj.data('jstree');
return {
'type' : false,
'max_depth' : obj.max_depth || -1,
'max_children' : obj.max_children || -1,
'valid_children' : obj.valid_children || -1
'max_depth' : obj && obj.max_depth ? obj.max_depth : -1,
'max_children' : obj && obj.max_children ? obj.max_children : -1,
'valid_children' : obj && obj.valid_children ? obj.valid_children : -1
};
}
if(!obj || !obj.length) { return false; }
Expand Down

0 comments on commit 37a247a

Please sign in to comment.