fix(client) ajaxLoad: set same current file after refresh

This commit is contained in:
coderaiser 2014-10-29 11:45:24 -04:00
parent 2816763922
commit c3ca226457

View file

@ -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);
});
};