Skip to content

Commit

Permalink
don't update directive in create
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed May 15, 2018
1 parent bca8d20 commit 7c6ae48
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
break;
default:
var elementDirectives = element.directives;
var code = "m[" + (element.index) + "]=m.ce(\"" + (element.type) + "\");" + (mapReduce(element.attributes, function (attribute) { return ("m[" + (element.index) + "].setAttribute(\"" + (attribute.key) + "\"," + (attributeValue(attribute)) + ");"); })) + "m.ca(m[" + (element.index) + "], " + parent + ");" + (mapReduce(element.children, function (child) { return generateCreate(child, ("m[" + (element.index) + "]"), root); }));
var code = "m[" + (element.index) + "]=m.ce(\"" + (element.type) + "\");" + (mapReduce(element.attributes, function (attribute) { return attribute.dynamic ? "" : ("m[" + (element.index) + "].setAttribute(\"" + (attribute.key) + "\"," + (attributeValue(attribute)) + ");"); })) + "m.ca(m[" + (element.index) + "], " + parent + ");" + (mapReduce(element.children, function (child) { return generateCreate(child, ("m[" + (element.index) + "]"), root); }));

for (var i = 0; i < elementDirectives.length; i++) {
var elementDirective = elementDirectives[i];
Expand Down
2 changes: 1 addition & 1 deletion dist/moon.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/compiler/generator/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const generateCreate = (element, parent, root) => {
break;
default:
const elementDirectives = element.directives;
let code = `m[${element.index}]=m.ce("${element.type}");${mapReduce(element.attributes, (attribute) => `m[${element.index}].setAttribute("${attribute.key}",${attributeValue(attribute)});`)}m.ca(m[${element.index}], ${parent});${mapReduce(element.children, (child) => generateCreate(child, `m[${element.index}]`, root))}`;
let code = `m[${element.index}]=m.ce("${element.type}");${mapReduce(element.attributes, (attribute) => attribute.dynamic ? "" : `m[${element.index}].setAttribute("${attribute.key}",${attributeValue(attribute)});`)}m.ca(m[${element.index}], ${parent});${mapReduce(element.children, (child) => generateCreate(child, `m[${element.index}]`, root))}`;

for (let i = 0; i < elementDirectives.length; i++) {
const elementDirective = elementDirectives[i];
Expand Down

0 comments on commit 7c6ae48

Please sign in to comment.