Index: branches/5.2.x/core/admin_templates/js/script.js =================================================================== diff -u -N -r14244 -r14572 --- branches/5.2.x/core/admin_templates/js/script.js (.../script.js) (revision 14244) +++ branches/5.2.x/core/admin_templates/js/script.js (.../script.js) (revision 14572) @@ -1497,8 +1497,14 @@ NumberFormatter.Parse = function(num) { - if (num == '') return 0; - return parseFloat( num.toString().replace(this.ThousandsSep, '').replace(this.DecimalSep, '.') ); + if (num == '') { + return 0; + } + + var $string = num.toString(); + + // we could have multiple thousand separators ! + return parseFloat( $string.replace(new RegExp(this.ThousandsSep, 'g'), '').replace(this.DecimalSep, '.') ); } NumberFormatter.Format = function(num) @@ -1779,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 + '_' : '';