Index: branches/5.1.x/core/admin_templates/js/uploader/upload_manager.js =================================================================== diff -u -N -r12657 -r13086 --- branches/5.1.x/core/admin_templates/js/uploader/upload_manager.js (.../upload_manager.js) (revision 12657) +++ branches/5.1.x/core/admin_templates/js/uploader/upload_manager.js (.../upload_manager.js) (revision 13086) @@ -67,17 +67,31 @@ UploadsManager.iterate = function($method, $timeout) { var $me = this; + var args = Array.prototype.slice.call(arguments); // convert to array - if (isset($timeout)) { + if ($timeout !== undefined) { + // 2nd parameter is given + if ((Object.prototype.toString.call($timeout) === '[object String]') && $timeout.match(/^timeout:([\d]+)$/)) { + // it's string in format "timeout:" + $timeout = parseInt(RegExp.$1); + } + else { + // this is not the timeout, but 1st parameter of iteratable method + $timeout = undefined; + } + } + + if ($timeout !== undefined) { // make delayed iteration (helps with direct innerHTML assignments in IE) - setTimeout(function() { $me.iterate($method); }, $timeout); + args.splice(args.length - 1, 1); // remove timeout + + setTimeout(function() { $me.iterate.apply($me, args); }, $timeout); return ; } - for (var i in this._Uploaders) { - var args = Array.prototype.slice.call(arguments); // convert to array - args.splice(0, 1); // remove method name + args.splice(0, 1); // remove method name + for (var i in this._Uploaders) { this._Uploaders[i][$method].apply(this._Uploaders[i], args); } }