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

View file

@ -1,11 +1,11 @@
var Util, DOM, CloudCmd;
var Util, DOM, CloudFunc, CloudCmd;
(function (Util, DOM) {
(function (Util, DOM, CloudFunc, CloudCmd) {
'use strict';
CloudCmd.Listeners = new ListenersProto(CloudCmd, Util, DOM);
CloudCmd.Listeners = new ListenersProto(Util, DOM, CloudFunc, CloudCmd);
function ListenersProto(CloudCmd, Util, DOM) {
function ListenersProto(Util, DOM, CloudFunc, CloudCmd) {
var Info = DOM.CurrentInfo,
Storage = DOM.Storage,
Events = DOM.Events,
@ -113,6 +113,7 @@ var Util, DOM, CloudCmd;
*/
link = Util.replaceStr(link, '%%', '%25%');
link = decodeURI(link);
link = Util.rmStrOnce(link, CloudFunc.FS) || '/';
CloudCmd.loadDir({
path : link,
@ -363,4 +364,4 @@ var Util, DOM, CloudCmd;
}
})(Util, DOM);
})(Util, DOM, CloudFunc, CloudCmd);