Minor code style corrections
This commit is contained in:
parent
3db21f1a70
commit
1a20665729
1 changed files with 8 additions and 4 deletions
|
|
@ -119,12 +119,14 @@
|
|||
},
|
||||
|
||||
pathForElement: function(element) {
|
||||
if (!element || !element.hasOwnProperty("parent") || element.parent == undefined)
|
||||
if (!element || !element.hasOwnProperty("parent") || element.parent == undefined) {
|
||||
return "";
|
||||
}
|
||||
|
||||
var recursivePath = function(element, path) {
|
||||
if (element.hasOwnProperty("parent") && element.parent != undefined)
|
||||
if (element.hasOwnProperty("parent") && element.parent != undefined) {
|
||||
return recursivePath(element.parent, element.name + "/" + path);
|
||||
}
|
||||
|
||||
return path;
|
||||
};
|
||||
|
|
@ -134,11 +136,13 @@
|
|||
|
||||
elementByPath: function(location, startElement) {
|
||||
var recursiveSearch = function(location, element) {
|
||||
if (location.length == 0)
|
||||
if (location.length == 0) {
|
||||
return element;
|
||||
}
|
||||
|
||||
if (!element.hasOwnProperty("children"))
|
||||
if (!element.hasOwnProperty("children")) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
var name = location.shift();
|
||||
for(var i = 0; i < element.children.length; i++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue