src/com/stilva/taquet/event/BubbleEventManager.js
/**
 * Given a dom node, it returns a collection of Backbone.Views
 * that are attached to the given tree, from the given node to all its leafs.
 * @param dom A given dom node to traverse all the way up
 * @returns Array containing Backbone.Views
 * @private
 */
Given a dom node, it returns a collection of Backbone.Views
that are attached to the given tree, from the given node to all its leafs.
@param dom A given dom node to traverse all the way up
@returns Array containing Backbone.Views
@private
Given a dom node it returns a collection of Backbone . Views that are attached to the given tree from the given node to all its leafs . @param dom A given dom node to traverse all the way up @returns Array containing Backbone . Views @private
function _bubbleDownHierarchy(dom) {
  var matched,
      index,
      child,
      children,
      tree    = [],
      cid     = null,
      pattern = /[^,\s]+/g;
  var concat = [].push,
      slice = [].slice;
  if(!dom) {
    return;
  }
  index = 0;
  children = [dom];
  while(child = children[index]) {
    concat.apply(children, slice.call(child.children));
    ++index;
  }
  while(child = children[--index]){
    cid = child.getAttribute(attribute);
    if(cid && (matched = cid.match(pattern))) {
      concat.apply(tree, matched);
    }
  }
  return tree;
}
function _bubbleDownHierarchy ( dom ) { var matched , index , child , children , tree = [ ] , cid = null , pattern = / [^,\s]+ / g ; var concat = [ ] . push , slice = [ ] . slice ; if ( ! dom ) { return ; } index = 0 ; children = [ dom ] ; while ( child = children [ index ] ) { concat . apply ( children , slice . call ( child . children ) ) ; ++ index ; } while ( child = children [ -- index ] ) { cid = child . getAttribute ( attribute ) ; if ( cid && ( matched = cid . match ( pattern ) ) ) { concat . apply ( tree , matched ) ; } } return tree ; }
Given a dom node, it returns a collection of Backbone.Views
 that are attached to the given tree, from the given node to all its leafs.
Given a dom node it returns a collection of Backbone . Views that are attached to the given tree from the given node to all its leafs .
// Flattens the dom tree into an array // Goes through the flattened tree and filters through the nodes