From 8a4787c875d305317255d2a33dfe3686fabf7914 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 10 Jul 2014 02:53:15 -0400 Subject: [PATCH] refactor(client) loadDir: rm getCurrentLink --- lib/client.js | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/lib/client.js b/lib/client.js index 0145ec6a..4a638d1f 100644 --- a/lib/client.js +++ b/lib/client.js @@ -34,9 +34,7 @@ var Util, DOM, CloudFunc; this.loadDir = function(params) { var link, imgPosition, panelChanged, pathParams, isRefresh, panel, history, - p = params, - currentLink = DOM.getCurrentLink(), - href = currentLink.href; + p = params; if (params) { pathParams = p.path; @@ -47,28 +45,24 @@ var Util, DOM, CloudFunc; if (pathParams) link = pathParams; - else - link = Util.rmStr(href, CloudCmd.HOST); - if (link || currentLink.target !== '_blank') { - if (panel && panel !== Info.panel) { - DOM.changePanel(); - panelChanged = true; - } - - if (panelChanged || isRefresh) - imgPosition = { - top: true - }; - - Images.showLoad(imgPosition); - - /* загружаем содержимое каталога */ - ajaxLoad(link, { - refresh : isRefresh, - history : history - }, panel); + if (panel && panel !== Info.panel) { + DOM.changePanel(); + panelChanged = true; } + + if (panelChanged || isRefresh) + imgPosition = { + top: true + }; + + Images.showLoad(imgPosition); + + /* загружаем содержимое каталога */ + ajaxLoad(link, { + refresh : isRefresh, + history : history + }, panel); }; /**