Permalink
Browse files

fix: EventCompiler ignored the events defined for the base-Element

  • Loading branch information...
MikeMitterer committed Nov 26, 2015
1 parent 3e4514c commit 3fa59d6e066de5f68606403665484faae7677005
Showing with 11 additions and 6 deletions.
  1. +7 −2 lib/src/application/modules/EventCompiler.dart
  2. +4 −4 lib/src/template/modules/TemplateRenderer.dart
@@ -102,10 +102,15 @@ class EventCompiler {
datasets.keys.forEach((final String dataset) {
final List<dom.Element> elements = element.querySelectorAll("[data-${dataset}]");
// Create new List because querySelectorAll returns a ImmutableList!
final List<dom.Element> elements = new List.from(element.querySelectorAll("[data-${dataset}]"));
if(element.attributes.containsKey("data-${dataset}")) {
// If the current element has this attribute add it to the list
elements.add(element);
}
if(elements.isNotEmpty) {
//_logger.info("Searching for '[data-${dataset}] in $element, found ${elements.length} subelements.");
_logger.info("Searching for '[data-${dataset}] in $element, found ${elements.length} subelements.");
}
elements.forEach( (final dom.Element element) {
@@ -53,11 +53,11 @@ class TemplateRenderer {
final Template mustacheTemplate = new Template(_template(),htmlEscapeValues: false);
/// _renderer.render calls componentFactory().upgradeElement(child)
final dom.Element child = await _renderer.render(
parent,mustacheTemplate.renderString(scope),replaceNode: !appendNewNodes);
// _renderer.render calls componentFactory().upgradeElement(child)
final String renderedTemplate = mustacheTemplate.renderString(scope);
final dom.Element child = await _renderer.render(parent,renderedTemplate,replaceNode: !appendNewNodes);
_eventCompiler.compileElement(scope,child);
return _eventCompiler.compileElement(scope,child);
}
return new Renderer(_render);

0 comments on commit 3fa59d6

Please sign in to comment.