fix(listeners) onPathElementClick: change path of active directory when click on path link of other panel

This commit is contained in:
coderaiser 2015-09-27 09:39:19 -04:00
parent 8c793b162b
commit 8cbb379b6e

View file

@ -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();