From c17d938830e533a86216ddcb2e7364dff111226e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 8 Aug 2012 13:04:33 +0300 Subject: [PATCH] fixed bug with go to parent directory From now, if parent directory not in view area, page will scroll to needed place. --- client.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client.js b/client.js index 5ac0c9a1..ddd2ba92 100644 --- a/client.js +++ b/client.js @@ -680,11 +680,11 @@ CloudClient._currentToParent = (function(pDirName){ /* опредиляем в какой мы панели: * правой или левой */ - var lCurrentFile = getByClass(CloudClient.CURRENT_FILE); - var lPanel = lCurrentFile[0].parentElement; + var lCurrentFile = Util.getCurrentFile(); + var lPanel = Util.getPanel(); /* убираем слэш с имени каталога*/ - pDirName=pDirName.replace('/',''); + pDirName = pDirName.replace('/',''); var lRootDir = getById(pDirName + '(' + lPanel.id + ')'); @@ -692,8 +692,10 @@ CloudClient._currentToParent = (function(pDirName){ * set it to current file */ if(lRootDir){ - !(lCurrentFile[0].className = '') && - (lRootDir.className = CloudClient.CURRENT_FILE); + lCurrentFile.className = ''; + + lRootDir.className = CloudClient.CURRENT_FILE; + lRootDir.scrollIntoViewIfNeeded(); } });