mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
moved uniqueId into context-helpers for raptor-templates
This commit is contained in:
parent
2d0eac25fa
commit
d1ee3dde61
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user