Commit ec0bdfb4 by Valera Rozuvan Committed by Alexander Kryklia

New feature: can specify output of "none" for a dynamic element.

parent 1770de73
...@@ -31,7 +31,7 @@ define('ElOutput', ['logme'], function (logme) { ...@@ -31,7 +31,7 @@ define('ElOutput', ['logme'], function (logme) {
// element. // element.
if ( if (
(typeof obj['@output'] !== 'string') || (typeof obj['@output'] !== 'string') ||
(obj['@output'].toLowerCase() !== 'element') ((obj['@output'].toLowerCase() !== 'element') && (obj['@output'].toLowerCase() !== 'none'))
) { ) {
return; return;
} }
...@@ -108,18 +108,22 @@ define('ElOutput', ['logme'], function (logme) { ...@@ -108,18 +108,22 @@ define('ElOutput', ['logme'], function (logme) {
paramNames.pop(); paramNames.pop();
el = $('#' + obj['@el_id']); if (obj['@output'].toLowerCase() !== 'none') {
el = $('#' + obj['@el_id']);
if (el.length !== 1) { if (el.length !== 1) {
logme( logme(
'ERROR: DOM element with ID "' + obj['@el_id'] + '" ' + 'ERROR: DOM element with ID "' + obj['@el_id'] + '" ' +
'not found. Dynamic element not created.' 'not found. Dynamic element not created.'
); );
return; return;
} }
el.html(func.apply(window, state.getAllParameterValues())); el.html(func.apply(window, state.getAllParameterValues()));
} else {
el = null;
}
state.addDynamicEl(el, func, obj['@el_id'], updateOnEvent); state.addDynamicEl(el, func, obj['@el_id'], updateOnEvent);
} }
......
...@@ -237,6 +237,10 @@ define('State', ['logme'], function (logme) { ...@@ -237,6 +237,10 @@ define('State', ['logme'], function (logme) {
allParameterValues[parameters[paramName].helperArrayIndex] = paramValueNum; allParameterValues[parameters[paramName].helperArrayIndex] = paramValueNum;
for (c1 = 0; c1 < dynamicEl.length; c1++) { for (c1 = 0; c1 < dynamicEl.length; c1++) {
if (dynamicEl[c1].el === null) {
continue;
}
if ( if (
((updateOnEvent !== undefined) && (dynamicEl[c1].updateOnEvent === updateOnEvent)) || ((updateOnEvent !== undefined) && (dynamicEl[c1].updateOnEvent === updateOnEvent)) ||
(updateOnEvent === undefined) (updateOnEvent === undefined)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment