mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-29 18:50:31 +00:00
fix(client) when none files in the root, menu doesn't work
This commit is contained in:
parent
6f7155e4d0
commit
cbcda32df2
4 changed files with 45 additions and 24 deletions
|
|
@ -419,16 +419,20 @@ var Util, DOM, CloudFunc, join;
|
|||
names = ['file', 'path', 'link', 'pathLink'];
|
||||
|
||||
Files.get(names, function(error, templFile, templPath, templLink, templPathLink) {
|
||||
var Dialog = DOM.Dialog,
|
||||
var childNodes, i,
|
||||
Dialog = DOM.Dialog,
|
||||
current,
|
||||
panel = panelParam || Info.panel,
|
||||
dir = Info.dir,
|
||||
name = Info.name,
|
||||
i = panel.childNodes.length;
|
||||
panel = panelParam || DOM.getPanel(),
|
||||
|
||||
dir = Info.dir,
|
||||
name = Info.name;
|
||||
|
||||
if (error) {
|
||||
Dialog.alert(error.responseText);
|
||||
} else {
|
||||
childNodes = panel.childNodes;
|
||||
i = childNodes.length;
|
||||
|
||||
while (i--)
|
||||
panel.removeChild(panel.lastChild);
|
||||
|
||||
|
|
@ -467,21 +471,18 @@ var Util, DOM, CloudFunc, join;
|
|||
* используеться при первом заходе в корень
|
||||
*/
|
||||
function getJSONfromFileTable() {
|
||||
var current, name, size, owner, mode, ret,
|
||||
var name, size, owner, mode, ret,
|
||||
path = DOM.getCurrentDirPath(),
|
||||
infoFiles = Info.files,
|
||||
infoFiles = Info.files || [],
|
||||
|
||||
fileTable = {
|
||||
path : path,
|
||||
files : []
|
||||
},
|
||||
|
||||
files = fileTable.files,
|
||||
|
||||
i, n = infoFiles.length;
|
||||
files = fileTable.files;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
current = infoFiles[i];
|
||||
[].forEach.call(infoFiles, function(current) {
|
||||
name = DOM.getCurrentName(current);
|
||||
size = DOM.getCurrentSize(current);
|
||||
owner = DOM.getCurrentOwner(current);
|
||||
|
|
@ -494,7 +495,7 @@ var Util, DOM, CloudFunc, join;
|
|||
mode : mode,
|
||||
owner : owner
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
ret = Util.json.stringify(fileTable);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue