fix(listeners) if click on path of passive panel change content on active panel

This commit is contained in:
coderaiser 2014-04-28 10:13:49 -04:00
parent 9f881dbdd8
commit 7181631450
2 changed files with 14 additions and 6 deletions

View file

@ -36,7 +36,7 @@ var Util, DOM, CloudFunc;
*/
this.loadDir = function(paramLink, needRefresh, panel) {
return function(event) {
var link,
var link, imgPosition, panelChanged,
currentLink = DOM.getCurrentLink(),
href = currentLink.href;
@ -48,9 +48,17 @@ var Util, DOM, CloudFunc;
link += '?json';
if (link || currentLink.target !== '_blank') {
Images.showLoad(!needRefresh ? null: {
top:true
});
if (panel && panel !== Info.panel) {
DOM.changePanel();
panelChanged = true;
}
if (panelChanged || needRefresh)
imgPosition = {
top: true
};
Images.showLoad(imgPosition);
/* загружаем содержимое каталога */
CloudCmd.ajaxLoad(link, {
@ -389,7 +397,7 @@ var Util, DOM, CloudFunc;
if (!ret && json) {
json = Util.parseJSON(json);
CloudCmd.createFileTable(json);
CloudCmd.createFileTable(json, panel);
setTitle();
} else
DOM.getCurrentFileContent({

View file

@ -97,7 +97,7 @@ var Util, DOM, CloudCmd;
for (i = 0; i < n; i++) {
ai = pathLinks[i];
link = Util.removeStr(ai.href, url),
loadDir = CloudCmd.loadDir(link),
loadDir = CloudCmd.loadDir(link, false, panel),
Events.addClick(loadDir, ai);
OnPathLinks.push(loadDir);
}