From f2b786446417a8bc55134135108fb72f25fd6684 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 17 Oct 2014 04:00:34 -0400 Subject: [PATCH] fix(dom) set current file after copy/move --- lib/client.js | 7 +------ lib/client/dom.js | 12 ++++++------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/client.js b/lib/client.js index d4efe24f..95c51353 100644 --- a/lib/client.js +++ b/lib/client.js @@ -307,16 +307,11 @@ var Util, DOM, CloudFunc, join; }; this.refresh = function(panelParam, callback) { - var panel, + var panel = panelParam || Info.panel, NEEDREFRESH = true, path = DOM.getCurrentDirPath(panel), notSlashlLink = CloudFunc.rmLastSlash(path) || '/'; - if (panel) - panel = panelParam; - else - panel = Info.panel; - CloudCmd.loadDir({ path : notSlashlLink, isRefresh : NEEDREFRESH, diff --git a/lib/client/dom.js b/lib/client/dom.js index a7e5a985..974c9cd7 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -1607,17 +1607,17 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; DOM.Storage.remove(path, function() { var panel = DOM.getPanel(), panelPassive = DOM.getPanel(true), - id = panelPassive.id, - dotDot = DOM.getById( '..(' + id + ')'); + setCurrent = function() { + var current = DOM.getCurrentFileByName(name); + DOM.setCurrentFile(current); + } if (!data) { - DOM.setCurrentFile(dotDot); - CloudCmd.refresh(panel); - CloudCmd.refresh(panelPassive); + CloudCmd.refresh(panelPassive, setCurrent); } else { CloudCmd.refresh(panelPassive); - CloudCmd.refresh(panel); + CloudCmd.refresh(panel, setCurrent); } }); });