mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-14 03:54:10 +01:00
Fixed problem with registered data callbacks, when the window the callback belongs to is closed
This commit is contained in:
parent
00cd1f1e2f
commit
eadeb57f28
@ -818,6 +818,19 @@ abstract class egw_framework
|
||||
// add link registry to non-popup windows, if explicit requested (idots_framework::navbar() loads it, if not explicit specified!)
|
||||
if ($GLOBALS['egw_info']['flags']['js_link_registry'])
|
||||
{
|
||||
$langs = array();
|
||||
|
||||
// load translations
|
||||
translation::add_app('etemplate');
|
||||
foreach(translation::$loaded_apps as $app => $lang)
|
||||
{
|
||||
$langs[] = array(
|
||||
"app" => $app,
|
||||
"lang" => $lang
|
||||
);
|
||||
}
|
||||
|
||||
$java_script .= "egw.langRequire(window, ".json_encode($langs).");\n";
|
||||
$java_script .= 'egw.set_preferences('.json_encode($GLOBALS['egw_info']['user']['preferences']['common']).', "common");'."\n";
|
||||
$java_script .= 'egw.set_user('.$GLOBALS['egw']->accounts->json($GLOBALS['egw_info']['user']['account_id']).');'."\n";
|
||||
}
|
||||
|
@ -344,12 +344,17 @@ egw.extend("data_storage", egw.MODULE_GLOBAL, function (_app, _wnd) {
|
||||
// those.
|
||||
if (typeof registeredCallbacks[_uid] != "undefined")
|
||||
{
|
||||
for (var i = 0; i < registeredCallbacks[_uid].length; i++)
|
||||
for (var i = registeredCallbacks[_uid].length - 1; i >= 0; i--)
|
||||
{
|
||||
registeredCallbacks[_uid][i].callback.call(
|
||||
registeredCallbacks[_uid][i].context,
|
||||
_data
|
||||
);
|
||||
try {
|
||||
registeredCallbacks[_uid][i].callback.call(
|
||||
registeredCallbacks[_uid][i].context,
|
||||
_data
|
||||
);
|
||||
} catch (e) {
|
||||
// Remove this callback from the list
|
||||
registeredCallbacks[_uid].splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user