mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
fix(client) ajaxLoad: mv rmStr FS to js-path-link
This commit is contained in:
parent
11d6fa7cbe
commit
8fe8ba6bf1
2 changed files with 10 additions and 12 deletions
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue