From 39827a6b5720ea3883932496209861b2c3f88bef Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 6 Oct 2014 09:08:02 -0400 Subject: [PATCH] feature(dom) uploadFiles: set current uploaded file --- lib/client/dom.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index 04fa0f61..77814679 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -405,7 +405,14 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; }; this.uploadFiles = function(files) { - var func = CloudCmd.refresh, + var func = function(name) { + return function() { + CloudCmd.refresh(null, function() { + var current = DOM.getCurrentFileByName(name); + DOM.setCurrentFile(current); + }); + }; + }, dir = CurrentInfo.dirPath, load = function(file, callback) { var Images = DOM.Images, @@ -422,7 +429,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; if (files.length) { Util.forEach(files, function(file) { - func = Util.exec.with(load, file, func); + func = Util.exec.with(load, file, func(file.name)); }); func();