mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(client) createFileTable: history -> options (history, noCurrent)
This commit is contained in:
parent
72598b88f6
commit
cb4d00828c
1 changed files with 17 additions and 14 deletions
|
|
@ -351,14 +351,13 @@ var Util, DOM, CloudFunc, join;
|
|||
name = Info.name,
|
||||
obj = Util.json.parse(json),
|
||||
isRefresh = options.refresh,
|
||||
noCurrent = options.noCurrent,
|
||||
history = options.history;
|
||||
noCurrent = options.noCurrent;
|
||||
|
||||
if (!isRefresh && json)
|
||||
createFileTable(obj, panel, history, callback);
|
||||
createFileTable(obj, panel, options, callback);
|
||||
else
|
||||
RESTful.read(path, 'json', function(obj) {
|
||||
createFileTable(obj, panel, history, function() {
|
||||
createFileTable(obj, panel, options, function() {
|
||||
var current;
|
||||
|
||||
if (isRefresh && !noCurrent) {
|
||||
|
|
@ -399,8 +398,10 @@ var Util, DOM, CloudFunc, join;
|
|||
* @param history
|
||||
* @param callback
|
||||
*/
|
||||
function createFileTable(json, panelParam, history, callback) {
|
||||
var names = ['file', 'path', 'link', 'pathLink'];
|
||||
function createFileTable(json, panelParam, options, callback) {
|
||||
var history = options.history,
|
||||
noCurrent = options.noCurrent,
|
||||
names = ['file', 'path', 'link', 'pathLink'];
|
||||
|
||||
Files.get(names, function(error, templFile, templPath, templLink, templPathLink) {
|
||||
var Dialog = DOM.Dialog,
|
||||
|
|
@ -429,15 +430,17 @@ var Util, DOM, CloudFunc, join;
|
|||
|
||||
Listeners.setOnPanel(panel.id);
|
||||
|
||||
if (name === '..' && dir !== '/')
|
||||
current = DOM.getCurrentByName(dir);
|
||||
|
||||
if (!current)
|
||||
current = DOM.getFiles(panel)[0];
|
||||
if (!noCurrent) {
|
||||
if (name === '..' && dir !== '/')
|
||||
current = DOM.getCurrentByName(dir);
|
||||
|
||||
DOM.setCurrentFile(current, {
|
||||
history: history
|
||||
});
|
||||
if (!current)
|
||||
current = DOM.getFiles(panel)[0];
|
||||
|
||||
DOM.setCurrentFile(current, {
|
||||
history: history
|
||||
});
|
||||
}
|
||||
|
||||
Util.exec(callback);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue