garding againts data set in egw object by reference from an other window, causing data to be inaccessible in IE after window closes

This commit is contained in:
Ralf Becker
2015-02-02 19:49:18 +00:00
parent 5a09fc60c1
commit 6bbf3661b2
10 changed files with 40 additions and 25 deletions

View File

@@ -37,13 +37,16 @@ egw.extend('lang', egw.MODULE_GLOBAL, function() {
*
* @param {string} _app
* @param {object} _messages message => translation pairs
* @param {boolean} _need_clone _messages need to be cloned, as it is from different window context
* and therefore will be inaccessible in IE, after that window is closed
* @memberOf egw
*/
set_lang_arr: function(_app, _messages)
set_lang_arr: function(_app, _messages, _need_clone)
{
if(!jQuery.isArray(_messages))
{
lang_arr[_app] = _messages;
// no deep clone jQuery.extend(true,...) neccessary, as _messages contains only string values
lang_arr[_app] = _need_clone ? jQuery.extend({}, _messages) : _messages;
}
},