moved uniqueId into context-helpers for raptor-templates

This commit is contained in:
Patrick Steele-Idem 2014-03-14 16:39:22 -06:00
parent 2d0eac25fa
commit d1ee3dde61

View File

@ -21,6 +21,22 @@ exports.extend = function(runtime, target) {
return this;
}
if (typeof window === 'undefined') {
target.uniqueId = function () {
var attrs = this.attributes;
if (!attrs._nextId) {
attrs._nextId = 0;
}
return attrs._nextId++;
};
} else {
var nextUniqueId = 0;
target.uniqueId = function() {
return 'c' + nextUniqueId++;
};
}
extend(target, {
__rtmpl: true,
invokeHandler: function (handler, input) {