mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(listeners) onPathElementClick: change path of active directory when click on path link of other panel
This commit is contained in:
parent
8c793b162b
commit
8cbb379b6e
1 changed files with 18 additions and 12 deletions
|
|
@ -85,12 +85,21 @@ var Util, DOM, CloudFunc, CloudCmd;
|
|||
return fn;
|
||||
}
|
||||
|
||||
function isNoCurrent(panel) {
|
||||
var noCurrent,
|
||||
infoPanel = Info.panel,
|
||||
namePanel = panel.getAttribute('data-name'),
|
||||
nameInfoPanel = infoPanel.getAttribute('data-name');
|
||||
|
||||
if (namePanel !== nameInfoPanel)
|
||||
noCurrent = true;
|
||||
|
||||
return noCurrent;
|
||||
}
|
||||
|
||||
function onPathElementClick(panel, event) {
|
||||
var link, href, url,
|
||||
namePanel,
|
||||
nameInfoPanel,
|
||||
infoPanel = Info.panel,
|
||||
noCurrent = false,
|
||||
noCurrent,
|
||||
element = event.target,
|
||||
attr = element.getAttribute('data-name');
|
||||
|
||||
|
|
@ -100,14 +109,8 @@ var Util, DOM, CloudFunc, CloudCmd;
|
|||
break;
|
||||
|
||||
case 'js-refresh':
|
||||
namePanel = panel.getAttribute('data-name');
|
||||
noCurrent = isNoCurrent(panel);
|
||||
|
||||
if (infoPanel)
|
||||
nameInfoPanel = infoPanel.getAttribute('data-name');
|
||||
|
||||
if (namePanel !== nameInfoPanel)
|
||||
noCurrent = true;
|
||||
|
||||
CloudCmd.refresh(panel, {
|
||||
noCurrent: noCurrent
|
||||
});
|
||||
|
|
@ -127,9 +130,12 @@ var Util, DOM, CloudFunc, CloudCmd;
|
|||
link = decodeURI(link);
|
||||
link = link.replace(CloudFunc.FS, '') || '/';
|
||||
|
||||
noCurrent = isNoCurrent(panel);
|
||||
|
||||
CloudCmd.loadDir({
|
||||
path : link,
|
||||
isRefresh : false
|
||||
isRefresh : false,
|
||||
panel : noCurrent ? panel : Info.panel
|
||||
});
|
||||
|
||||
event.preventDefault();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue