Index: branches/5.0.x/core/admin_templates/js/uploader/upload_manager.js =================================================================== diff -u -N -r12395 -r12791 --- branches/5.0.x/core/admin_templates/js/uploader/upload_manager.js (.../upload_manager.js) (revision 12395) +++ branches/5.0.x/core/admin_templates/js/uploader/upload_manager.js (.../upload_manager.js) (revision 12791) @@ -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); } } Index: branches/5.0.x/core/admin_templates/js/uploader/uploader.js =================================================================== diff -u -N -r12595 -r12791 --- branches/5.0.x/core/admin_templates/js/uploader/uploader.js (.../uploader.js) (revision 12595) +++ branches/5.0.x/core/admin_templates/js/uploader/uploader.js (.../uploader.js) (revision 12791) @@ -364,7 +364,7 @@ this._prepareFiles(); // sync position of all uploaders below current, because file queue height change will not affect their positions - UploadsManager.iterate('syncBrowseButton', 0); + UploadsManager.iterate('syncBrowseButton', 'timeout:0'); } Uploader.prototype.removeFile = function (file) { @@ -603,7 +603,7 @@ } Uploader.prototype.disableBrowse = function($disabled) { - if (!isset($disabled)) { + if ($disabled === undefined) { $disabled = true; }