mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
fix(listeners) setOnPanel: add preventDefault
This commit is contained in:
parent
89ae01fc6d
commit
8ce8ffaba0
1 changed files with 9 additions and 5 deletions
|
|
@ -80,14 +80,18 @@ var Util, DOM, CloudCmd;
|
|||
};
|
||||
|
||||
this.setOnPanel = function(panelId) {
|
||||
var i, n, ai, link, loadDir,
|
||||
var i, n, ai, link, load,
|
||||
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,
|
||||
clearStorage = DOM.getByDataName('js-clear-storage', pathElement),
|
||||
refresh = DOM.getByDataName('js-refresh', pathElement);
|
||||
refresh = DOM.getByDataName('js-refresh', pathElement),
|
||||
loadDir = function(params, event) {
|
||||
CloudCmd.loadDir(params);
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
/* ставим загрузку гифа на клик*/
|
||||
Events.addClick(onRefreshClick, refresh);
|
||||
|
|
@ -97,13 +101,13 @@ var Util, DOM, CloudCmd;
|
|||
for (i = 0; i < n; i++) {
|
||||
ai = pathLinks[i];
|
||||
link = Util.rmStr(ai.href, url),
|
||||
loadDir = Util.bind(CloudCmd.loadDir, {
|
||||
load = Util.bind(loadDir, {
|
||||
path : link,
|
||||
isRefresh : false,
|
||||
panel : panel
|
||||
}),
|
||||
Events.addClick(loadDir, ai);
|
||||
OnPathLinks.push(loadDir);
|
||||
Events.addClick(load, ai);
|
||||
OnPathLinks.push(load);
|
||||
}
|
||||
|
||||
Events.add(EventsFiles, filesElement);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue