fixed bug with building file table from json data, when we go around and come back to root dir

This commit is contained in:
coderaiser 2012-07-18 15:10:17 +03:00
parent 7ecc4e2909
commit 723bb9f9c3

View file

@ -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;