Skip to content

Commit

Permalink
Added check if observable._expressions has current expression and add…
Browse files Browse the repository at this point in the history
…s it

if it's not exists.

Fixes #113.
  • Loading branch information
Joscha Rohmann committed Nov 13, 2015
1 parent 6e96796 commit c72c83b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/query/observable.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ define([
var value;
var isProperty;
var propertyName;
var rawValue;

Observer.startObserving();

Expand All @@ -183,7 +184,8 @@ define([
}

try {
value = blocks.unwrap(parameterQueryCache[expression.expression](context));
rawValue = parameterQueryCache[expression.expression](context);
value = blocks.unwrap(rawValue);
} catch (ex) {
value = '';
}
Expand All @@ -197,6 +199,10 @@ define([
propertyName = expression.attr ? dom.propFix[expression.attr.toLowerCase()] || expression.attr : null;

if (element) {
if (blocks.isObservable(rawValue) && rawValue._expressions.indexOf(expression) == -1) {
rawValue._expressions.push(expression);
}

if (expression.attr) {
if(isProperty) {
element[propertyName] = Expression.GetValue(context, null, expression.entire);
Expand Down

0 comments on commit c72c83b

Please sign in to comment.