From c3ca226457d24e9b0dacde0f0f7107971a7ed356 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 29 Oct 2014 11:45:24 -0400 Subject: [PATCH] fix(client) ajaxLoad: set same current file after refresh --- lib/client.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index 786646c6..1a5466f1 100644 --- a/lib/client.js +++ b/lib/client.js @@ -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); }); };