From 723bb9f9c326a65236ba3803e78a2a916766d20a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 18 Jul 2012 15:10:17 +0300 Subject: [PATCH] fixed bug with building file table from json data, when we go around and come back to root dir --- client.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/client.js b/client.js index 8db092ac..ccb50bb6 100644 --- a/client.js +++ b/client.js @@ -697,7 +697,20 @@ CloudClient._getJSONfromFileTable=function() var lIsDir=lLI[i].getElementsByClassName('mini-icon')[0] .className.replace('mini-icon ','')==='directory'?true:false; - var lName=lLI[i].getElementsByClassName('name')[0].textContent; + var lName=lLI[i].getElementsByClassName('name')[0] + lName && + (lName = lName.getElementsByTagName('a') + /* if found link to folder + * cheking is it a full name + * or short + */ + lName.length && + (lName = lName.title); + /* if short we got title + * if full - getting textConent + */ + lName || + (lName = lName.textContent); /* если это папка - выводим слово dir вместо размера*/ var lSize=lIsDir?'dir':lLI[i].getElementsByClassName('size')[0].textContent; var lMode=lLI[i].getElementsByClassName('mode')[0].textContent;