Skip to content

Commit

Permalink
removed collection module, improved rep fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
cadorn committed Dec 9, 2009
1 parent 4f1f788 commit e07365b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 157 deletions.
143 changes: 0 additions & 143 deletions lib/collection.js

This file was deleted.

22 changes: 8 additions & 14 deletions lib/default-rep.js
Expand Up @@ -19,33 +19,27 @@ DefaultRep.prototype.toString = function()
return "[default-rep]";
}

/*
DefaultRep.prototype._appender = function(object, row, rep)
{
var ret = rep.tag.append({
node: object
}, row);
return ret;
};
*/

DefaultRep.prototype.setTemplatePack = function(pack)
{
this.pack = pack;
};

DefaultRep.prototype.getRepTagForNode = function(node) {
return this.getRepForNode(node).tag;
var rep = this.getRepForNode(node);
if(!rep) return false;
return rep.tag;
}

DefaultRep.prototype.getRepForNode = function(node)
{
if(!this.pack) {
throw "No template pack set for rep: " + this.toString();
}

return this.pack.seekTemplate(node).rep;
var id = node.getTemplateId();
if(id) {
return this.pack.getTemplate(id, true).rep;
}
return this.pack.seekTemplate(node, true).rep;
};


Expand Down

0 comments on commit e07365b

Please sign in to comment.