Skip to content

Commit

Permalink
building a tree of all presentaion elements
Browse files Browse the repository at this point in the history
  • Loading branch information
ittayd committed Mar 17, 2012
1 parent 9c56247 commit 4fb8367
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions core/js/Node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
define(function(require) {
var $ = require('jquery'),
options = require('options'),
selector = options.stepSelectors.join(",")


var result = function Node(elem) {
elem = this.elem = $(elem);
this.children = []

elem.attr('visited', "true")
var self = this,
elems = $(elem).find(selector)


elems.each(function(_, elem) {
if(!elem.getAttribute('visited')) {
self.children.push(new Node(elem))
}
})

}

result.prototype = {

}

result.prototype.constructor = result

return result;
})

0 comments on commit 4fb8367

Please sign in to comment.