fixed not working options for readonly radiobutton eg. "something,♥": missing legacyOptions for et2_radionbox_ro and no entity_decoding from attributes in template (they require it because of xml)

This commit is contained in:
Ralf Becker 2014-02-13 17:29:02 +00:00
parent 86bfd86826
commit 6df2fa827d
2 changed files with 14 additions and 1 deletions

View File

@ -156,7 +156,7 @@ function et2_checkType(_val, _type, _attr, _widget)
{
if (typeof _val == "string")
{
return _val;
return html_entity_decode(_val);
}
// Handle some less common possibilities
@ -790,3 +790,14 @@ function et2_call(_func)
}
return func.apply(parent, args);
}
/**
* Decode html entities so they can be added via .text(_str), eg. html_entity_decode('&') === '&'
*
* @param {string} _str
* @returns {string}
*/
function html_entity_decode(_str)
{
return _str && _str.indexOf('&') != -1 ? jQuery('<span>'+_str+'</span>').text() : _str;
}

View File

@ -169,6 +169,8 @@ var et2_radiobox_ro = et2_valueWidget.extend([et2_IDetachedDOM],
}
},
legacyOptions: ["set_value", "ro_true", "ro_false"],
/**
* Constructor
*