feature(client) refresh: current, panel[, callbac]k -> panel[, callback]

This commit is contained in:
coderaiser 2014-10-06 06:36:15 -04:00
parent c2f44c061a
commit af6d9752c2
2 changed files with 12 additions and 10 deletions

View file

@ -306,13 +306,15 @@ var Util, DOM, CloudFunc, join;
});
};
this.refresh = function(current, panelParam, callback) {
var NEEDREFRESH = true,
panel = panelParam || current && current.parentElement,
this.refresh = function(panelParam, callback) {
var panel,
NEEDREFRESH = true,
path = DOM.getCurrentDirPath(panel),
notSlashlLink = CloudFunc.rmLastSlash(path) || '/';
if (!panel)
if (panel)
panel = panelParam;
else
panel = Info.panel;
CloudCmd.loadDir({

View file

@ -465,7 +465,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
if (name)
RESTful.write(path, function() {
CloudCmd.refresh(null, null, function() {
CloudCmd.refresh(null, function() {
var current = DOM.getCurrentFileByName(name);
DOM.setCurrentFile(current);
@ -502,7 +502,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
if (name && name !== '..')
op(fileFrom, function() {
CloudCmd.refresh(null, null, function() {
CloudCmd.refresh(null, function() {
var byName = DOM.getCurrentFileByName,
dir = byName(nameDir),
file = byName(nameFile);
@ -1604,11 +1604,11 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
if (!data) {
DOM.setCurrentFile(dotDot);
CloudCmd.refresh(dotDot, panel);
CloudCmd.refresh(dotDot, panelPassive);
CloudCmd.refresh(panel);
CloudCmd.refresh(panelPassive);
} else {
CloudCmd.refresh(dotDot, panelPassive);
CloudCmd.refresh(dotDot, panel);
CloudCmd.refresh(panelPassive);
CloudCmd.refresh(panel);
}
});
});