diff --git a/lib/client.js b/lib/client.js index f234ae6c..d5c5a235 100644 --- a/lib/client.js +++ b/lib/client.js @@ -387,27 +387,17 @@ var Util, DOM, CloudFunc; Util.log ('reading dir: "' + cleanPath + '";'); - /* если доступен localStorage и - * в нём есть нужная нам директория - - * читаем данные с него и - * выходим - * если стоит поле обязательной перезагрузки - - * перезагружаемся - */ Storage.get(cleanPath, function(json) { - var ret = options && options.refresh; + var RESTful = DOM.RESTful, + obj = Util.parseJSON(json), + isRefresh = options && options.refresh; - if (!ret && json) { - json = Util.parseJSON(json); - CloudCmd.createFileTable(json, panel); - } else - DOM.getCurrentFileContent({ - url : fsPath, - dataType : 'json', - success : function(json) { - CloudCmd.createFileTable(json, panel); - Storage.set(cleanPath, json); - } + if (!isRefresh && json) + CloudCmd.createFileTable(obj, panel); + else + RESTful.read(cleanPath, function(json) { + CloudCmd.createFileTable(json, panel); + Storage.set(cleanPath, json); }); }); };