async file
This commit is contained in:
parent
a119370a23
commit
f4693a6eee
|
@ -13,7 +13,7 @@
|
|||
"Keymap": "wide",
|
||||
"Created": 1414080000000000000,
|
||||
"Updated": 1414080000000000000,
|
||||
"Lived": 1414080000000000000,
|
||||
"Lived": 1443322949749873692,
|
||||
"Editor": {
|
||||
"FontFamily": "Consolas, 'Courier New', monospace",
|
||||
"FontSize": "13px",
|
||||
|
@ -22,8 +22,12 @@
|
|||
"TabSize": "4"
|
||||
},
|
||||
"LatestSessionContent": {
|
||||
"FileTree": [],
|
||||
"Files": [],
|
||||
"FileTree": [
|
||||
"/Users/Vanessa/Work/GoGoGo/src"
|
||||
],
|
||||
"Files": [
|
||||
"/Users/Vanessa/Work/GoGoGo/src/1.css"
|
||||
],
|
||||
"CurrentFile": "",
|
||||
"FileTreeLayout": null,
|
||||
"EditorLayout": null,
|
||||
|
|
|
@ -165,8 +165,36 @@ var session = {
|
|||
|
||||
switch (data.cmd) {
|
||||
case 'create-file':
|
||||
var dirNode = tree.fileTree.getNodeByTId(tree.getTIdByPath(data.dir)),
|
||||
name = data.path.replace(data.dir + '/', ''),
|
||||
mode = CodeMirror.findModeByFileName(name),
|
||||
iconSkin = wide.getClassBySuffix(name.split(".")[1]);
|
||||
|
||||
if (data.type && data.type === 'file') {
|
||||
tree.fileTree.addNodes(dirNode, [{
|
||||
"name": name,
|
||||
"iconSkin": iconSkin,
|
||||
"path": data.path,
|
||||
"mode": mode,
|
||||
"removable": true,
|
||||
"creatable": true
|
||||
}]);
|
||||
|
||||
} else {
|
||||
tree.fileTree.addNodes(dirNode, [{
|
||||
"name": name,
|
||||
"iconSkin": "ico-ztree-dir ",
|
||||
"path": data.path,
|
||||
"removable": true,
|
||||
"creatable": true,
|
||||
"isParent": true
|
||||
}]);
|
||||
}
|
||||
|
||||
break;
|
||||
case 'remove-file':
|
||||
var dirNode = tree.fileTree.getNodeByTId(tree.getTIdByPath(data.dir));
|
||||
tree.fileTree.removeNode(dirNode);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue