fix(client) ajaxLoad: mv rmStr FS to js-path-link

This commit is contained in:
coderaiser 2014-06-26 09:12:23 -04:00
parent 11d6fa7cbe
commit 8fe8ba6bf1
2 changed files with 10 additions and 12 deletions

View file

@ -321,15 +321,12 @@ var Util, DOM, CloudFunc;
* { refresh, nohistory } - необходимость обновить данные о каталоге
*/
function ajaxLoad(path, options, panel) {
var SLASH = '/',
cleanPath = Util.rmStrOnce(path, CloudFunc.FS) || SLASH;
if (!options)
options = {};
Util.log ('reading dir: "' + cleanPath + '";');
Util.log ('reading dir: "' + path + '";');
Storage.get(cleanPath, function(error, json) {
Storage.get(path, function(error, json) {
var RESTful = DOM.RESTful,
obj = Util.parseJSON(json),
isRefresh = options.refresh,
@ -338,9 +335,9 @@ var Util, DOM, CloudFunc;
if (!isRefresh && json)
createFileTable(obj, panel, nohistory);
else
RESTful.read(cleanPath, 'json', function(obj) {
RESTful.read(path, 'json', function(obj) {
createFileTable(obj, panel, nohistory);
Storage.set(cleanPath, obj);
Storage.set(path, obj);
});
});
}