derby-templates
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -10,2 +10,3 @@ var saddle = require('saddle'); | ||
exports.Marker = Marker; | ||
exports.View = View; | ||
@@ -21,3 +22,2 @@ exports.ViewInstance = ViewInstance; | ||
exports.ComponentOn = ComponentOn; | ||
exports.ComponentMarker = ComponentMarker; | ||
exports.AsProperty = AsProperty; | ||
@@ -109,2 +109,20 @@ exports.AsObject = AsObject; | ||
var markerHooks = [{ | ||
emit: function(context, node) { | ||
node.$component = context.controller; | ||
context.controller.markerNode = node; | ||
} | ||
}]; | ||
function Marker(data) { | ||
saddle.Comment.call(this, data, markerHooks); | ||
} | ||
Marker.prototype = Object.create(saddle.Comment.prototype); | ||
Marker.prototype.type = 'Marker'; | ||
Marker.prototype.serialize = function() { | ||
return serializeObject.instance(this, this.data); | ||
} | ||
Marker.prototype.get = function() { | ||
return ''; | ||
}; | ||
function ViewAttributesMap(source) { | ||
@@ -206,4 +224,3 @@ var items = source.split(/\s+/); | ||
if (this.componentFactory) { | ||
var hooks = [new ComponentMarker()]; | ||
var marker = new saddle.Comment(this.name, hooks); | ||
var marker = new Marker(this.name); | ||
this.template.content.unshift(marker); | ||
@@ -450,13 +467,2 @@ } | ||
function ComponentMarker() {} | ||
ComponentMarker.prototype = Object.create(MarkupHook.prototype); | ||
ComponentMarker.prototype.type = 'ComponentMarker'; | ||
ComponentMarker.prototype.serialize = function() { | ||
return serializeObject.instance(this); | ||
}; | ||
ComponentMarker.prototype.emit = function(context, node) { | ||
node.$component = context.controller; | ||
context.controller.markerNode = node; | ||
}; | ||
function AsProperty(segments) { | ||
@@ -463,0 +469,0 @@ this.segments = segments; |
{ | ||
"name": "derby-templates", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54126
1469