mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(listeners) setOnPanel
This commit is contained in:
parent
e105fb493d
commit
1b943cff28
1 changed files with 11 additions and 13 deletions
|
|
@ -80,12 +80,11 @@ var Util, DOM, CloudCmd;
|
|||
};
|
||||
|
||||
this.setOnPanel = function(panelId) {
|
||||
var i, n, ai, link, load,
|
||||
url = CloudCmd.HOST,
|
||||
var url = CloudCmd.HOST,
|
||||
panel = DOM.getById(panelId),
|
||||
filesElement = DOM.getByDataName('js-files', panel),
|
||||
pathElement = DOM.getByDataName('js-path', panel),
|
||||
pathLinks = DOM.getByDataName('js-links', pathElement).children,
|
||||
pathLinks = DOM.getByDataName('js-links', pathElement),
|
||||
clearStorage = DOM.getByDataName('js-clear-storage', pathElement),
|
||||
refresh = DOM.getByDataName('js-refresh', pathElement),
|
||||
loadDir = function(params, event) {
|
||||
|
|
@ -97,18 +96,17 @@ var Util, DOM, CloudCmd;
|
|||
Events.addClick(onRefreshClick, refresh);
|
||||
Events.addClick(Storage.clear, clearStorage);
|
||||
|
||||
n = pathLinks.length;
|
||||
for (i = 0; i < n; i++) {
|
||||
ai = pathLinks[i];
|
||||
link = Util.rmStr(ai.href, url),
|
||||
load = Util.exec.with(loadDir, {
|
||||
path : link,
|
||||
isRefresh : false,
|
||||
panel : panel
|
||||
}),
|
||||
pathLinks.children.forEach(function(ai) {
|
||||
var link = Util.rmStr(ai.href, url),
|
||||
load = Util.exec.with(loadDir, {
|
||||
path : link,
|
||||
isRefresh : false,
|
||||
panel : panel
|
||||
});
|
||||
|
||||
Events.addClick(load, ai);
|
||||
OnPathLinks.push(load);
|
||||
}
|
||||
});
|
||||
|
||||
Events.add(EventsFiles, filesElement);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue