From 7181631450e05987e2f1b270d702e0ea1e7c74a5 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 28 Apr 2014 10:13:49 -0400 Subject: [PATCH] fix(listeners) if click on path of passive panel change content on active panel --- lib/client.js | 18 +++++++++++++----- lib/client/listeners.js | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/client.js b/lib/client.js index cdcc07ee..8f47a580 100644 --- a/lib/client.js +++ b/lib/client.js @@ -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({ diff --git a/lib/client/listeners.js b/lib/client/listeners.js index e552eedf..883ac322 100644 --- a/lib/client/listeners.js +++ b/lib/client/listeners.js @@ -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); }