mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(client) ajaxLoad: set same current file after refresh
This commit is contained in:
parent
2816763922
commit
c3ca226457
1 changed files with 10 additions and 1 deletions
|
|
@ -317,6 +317,7 @@ var Util, DOM, CloudFunc, join;
|
|||
function ajaxLoad(path, options, panel, callback) {
|
||||
var create = function(error, json) {
|
||||
var RESTful = DOM.RESTful,
|
||||
name = Info.name,
|
||||
obj = Util.json.parse(json),
|
||||
isRefresh = options.refresh,
|
||||
history = options.history;
|
||||
|
|
@ -325,7 +326,15 @@ var Util, DOM, CloudFunc, join;
|
|||
createFileTable(obj, panel, history, callback);
|
||||
else
|
||||
RESTful.read(path, 'json', function(obj) {
|
||||
createFileTable(obj, panel, history, callback);
|
||||
createFileTable(obj, panel, history, function() {
|
||||
var current;
|
||||
|
||||
if (isRefresh) {
|
||||
current = DOM.getCurrentByName(name);
|
||||
DOM.setCurrentFile(current);
|
||||
}
|
||||
|
||||
});
|
||||
Storage.set(path, obj);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue