Skip to content

Commit c72c83b

Browse files
author
Joscha Rohmann
committed
Added check if observable._expressions has current expression and adds it
if it's not exists. Fixes #113.
1 parent 6e96796 commit c72c83b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/query/observable.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ define([
170170
var value;
171171
var isProperty;
172172
var propertyName;
173+
var rawValue;
173174

174175
Observer.startObserving();
175176

@@ -183,7 +184,8 @@ define([
183184
}
184185

185186
try {
186-
value = blocks.unwrap(parameterQueryCache[expression.expression](context));
187+
rawValue = parameterQueryCache[expression.expression](context);
188+
value = blocks.unwrap(rawValue);
187189
} catch (ex) {
188190
value = '';
189191
}
@@ -197,6 +199,10 @@ define([
197199
propertyName = expression.attr ? dom.propFix[expression.attr.toLowerCase()] || expression.attr : null;
198200

199201
if (element) {
202+
if (blocks.isObservable(rawValue) && rawValue._expressions.indexOf(expression) == -1) {
203+
rawValue._expressions.push(expression);
204+
}
205+
200206
if (expression.attr) {
201207
if(isProperty) {
202208
element[propertyName] = Expression.GetValue(context, null, expression.entire);

0 commit comments

Comments
 (0)