Skip to content

Commit

Permalink
Now cloning __props__ and changed order in 'with'
Browse files Browse the repository at this point in the history
Cloning the __props__ property of contexts to prevent it from being
overwritten e.g. with new Views and changed the order of execution in the
'with'-data-querie to first push the context and then modify it.
  • Loading branch information
Joscha Rohmann committed Jan 20, 2016
1 parent b72e8cc commit f0488a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/query/DomQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ define([
$parents: context ? models : [],
$index: this._dataIndex || null,
$parentContext: context || null,
__props__: context && context.__props__
__props__: blocks.clone(context && context.__props__)
};
newContext.$context = newContext;
this._context = newContext;
Expand Down
3 changes: 2 additions & 1 deletion src/query/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,11 @@ define([
if (this._renderMode != VirtualElement.RenderMode.None) {
var renderEndTag = this.renderEndTag;

domQuery.pushContext(value);

if (name) {
domQuery.addProperty(name, value);
}
domQuery.pushContext(value);

this.renderEndTag = function () {
domQuery.popContext();
Expand Down

0 comments on commit f0488a4

Please sign in to comment.