Index: branches/5.1.x/core/admin_templates/js/script.js =================================================================== diff -u -N -r14147 -r14210 --- branches/5.1.x/core/admin_templates/js/script.js (.../script.js) (revision 14147) +++ branches/5.1.x/core/admin_templates/js/script.js (.../script.js) (revision 14210) @@ -1785,6 +1785,28 @@ return getFrame('main').TB.remove(); } +function onAfterWindowClose($redirect_url, $open_new_window, $force_skip_refresh) { + if ($open_new_window) { + var $ru = $redirect_url; + + // setTimeout allows to call method indirectly. Without it whole idea won't work 2nd time (try adding 2 relations one after another) + setTimeout( + function() { + openSelector('adm', $ru.replace('%5C', '\\') + '&merge_opener_stack=1'); + }, + 200 + ); + + return ; + } + + window.focus(); + + if ( !(($force_skip_refresh === true) || (typeof $skip_refresh != 'undefined' && $skip_refresh)) ) { + window.location.href = $redirect_url.replace('%5C', '\\'); + } +} + function get_control($mask, $field, $append, $prepend) { $append = $append !== undefined ? '_' + $append : ''; $prepend = $prepend !== undefined ? $prepend + '_' : '';