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) {
// element.
if (
(typeof obj['@output'] !== 'string') ||
(obj['@output'].toLowerCase() !== 'element')
((obj['@output'].toLowerCase() !== 'element') && (obj['@output'].toLowerCase() !== 'none'))
) {
return;
}
......@@ -108,18 +108,22 @@ define('ElOutput', ['logme'], function (logme) {
paramNames.pop();
el = $('#' + obj['@el_id']);
if (obj['@output'].toLowerCase() !== 'none') {
el = $('#' + obj['@el_id']);
if (el.length !== 1) {
logme(
'ERROR: DOM element with ID "' + obj['@el_id'] + '" ' +
'not found. Dynamic element not created.'
);
if (el.length !== 1) {
logme(
'ERROR: DOM element with ID "' + obj['@el_id'] + '" ' +
'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);
}
......
......@@ -237,6 +237,10 @@ define('State', ['logme'], function (logme) {
allParameterValues[parameters[paramName].helperArrayIndex] = paramValueNum;
for (c1 = 0; c1 < dynamicEl.length; c1++) {
if (dynamicEl[c1].el === null) {
continue;
}
if (
((updateOnEvent !== undefined) && (dynamicEl[c1].updateOnEvent === updateOnEvent)) ||
(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