feature(client) refresh: add noCurrent

This commit is contained in:
coderaiser 2015-02-13 04:11:49 -05:00
parent 83c8ea7e06
commit cf42ba4ea4
2 changed files with 14 additions and 7 deletions

View file

@ -77,7 +77,8 @@ var Util, DOM, CloudFunc, join;
/* загружаем содержимое каталога */
ajaxLoad(link, {
refresh : isRefresh,
history : history
history : history,
noCurrent : params.noCurrent
}, panel, callback);
};
@ -298,17 +299,23 @@ var Util, DOM, CloudFunc, join;
});
};
this.refresh = function(panelParam, callback) {
this.refresh = function(panelParam, options, callback) {
var panel = panelParam || Info.panel,
NEEDREFRESH = true,
path = DOM.getCurrentDirPath(panel),
notSlashlLink = CloudFunc.rmLastSlash(path);
if (!callback) {
callback = options;
options = {};
}
CloudCmd.loadDir({
path : notSlashlLink,
isRefresh : NEEDREFRESH,
history : false,
panel : panel
panel : panel,
noCurrent : options.noCurrent
}, callback);
};
@ -328,6 +335,7 @@ var Util, DOM, CloudFunc, join;
name = Info.name,
obj = Util.json.parse(json),
isRefresh = options.refresh,
noCurrent = options.noCurrent,
history = options.history;
if (!isRefresh && json)
@ -337,7 +345,7 @@ var Util, DOM, CloudFunc, join;
createFileTable(obj, panel, history, function() {
var current;
if (isRefresh) {
if (isRefresh && !noCurrent) {
current = DOM.getCurrentByName(name);
DOM.setCurrentFile(current);
}

View file

@ -1642,9 +1642,8 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
DOM.setCurrentFile(current);
};
CloudCmd.refresh(panelPassive, function() {
CloudCmd.refresh(panel, setCurrent);
});
CloudCmd.refresh(panelPassive, {noCurrent: true});
CloudCmd.refresh(panel, setCurrent);
});
});
}