Sha256: 9c8d0f9d66032630064f2f7f12909a71a52a971e5f9672cb53f21743d3e217c3

Contents?: true

Size: 1.65 KB

Versions: 2

Compression:

Stored size: 1.65 KB

Contents

{I"
class:ETI"ProcessedAsset;FI"logical_path;TI"peoplefinder/org_tree.js;FI"
pathname;TI"W/Users/jakub/code/moj/peoplefinder/app/assets/javascripts/peoplefinder/org_tree.js;FI"content_type;TI"application/javascript;TI"
mtime;Tl+Ñ_WTI"length;Ti|I"digest;TI"%4d85c66a52e8b72e42aec0daea97e3ee;FI"source;TI"|function OrgTree(tree, currentNodeId) {
  this.tree = this.augmentTree(tree, currentNodeId, false);
}

OrgTree.prototype.augmentTree = function(node, currentNodeId, disabled) {
  var self = this;

  if (node.id === currentNodeId) { disabled = true; }

  return {
    id: node.id,
    name: node.name,
    url: node.url,
    disabled: disabled,
    children: node.children.map(function(child) {
      return self.augmentTree(child, currentNodeId, disabled);
    })
  };
};

OrgTree.prototype.pathToNodeId = function(id, node, path) {
  var self = this;

  node = node || self.tree;
  path = path || [node];

  if (!id) { return [self.tree]; }
  if (node.id === id) { return path; }

  for (var i = 0, ii = node.children.length; i < ii; i++) {
    var child = node.children[i];
    var res = self.pathToNodeId(id, child, path.concat(child));
    if (res) { return res; }
  }

  return null;
};
;TI"dependency_digest;TI"%f5c2db942077c8769157b5fe87f4f30b;FI"required_paths;T[I"W/Users/jakub/code/moj/peoplefinder/app/assets/javascripts/peoplefinder/org_tree.js;FI"dependency_paths;T[{I"	path;TI"W/Users/jakub/code/moj/peoplefinder/app/assets/javascripts/peoplefinder/org_tree.js;FI"
mtime;TI"2014-11-03T10:58:25+00:00;TI"digest;TI"%4d85c66a52e8b72e42aec0daea97e3ee;FI"
_version;TI"%01511319732b44ed6445e68132ed559b;F

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
peoplefinder-0.1.1 spec/dummy/tmp/cache/assets/development/sprockets/18e14c35bef0e0b30c790f28e4c1c1c1
peoplefinder-0.1.0 spec/dummy/tmp/cache/assets/development/sprockets/18e14c35bef0e0b30c790f28e4c1c1c1