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

This commit is contained in:
Valera Rozuvan
2013-01-11 15:59:54 +02:00
committed by Alexander Kryklia
parent 1770de73f1
commit ec0bdfb445
2 changed files with 18 additions and 10 deletions

View File

@@ -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,19 +108,23 @@ 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()));
} else {
el = null;
}
el.html(func.apply(window, state.getAllParameterValues()));
state.addDynamicEl(el, func, obj['@el_id'], updateOnEvent);
}

View File

@@ -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)