rewrited sizing of names if they are to long thrue css, from JavaScript

This commit is contained in:
coderaiser 2012-11-04 04:45:31 -05:00
parent c034e23807
commit d0df126855
3 changed files with 15 additions and 24 deletions

View file

@ -183,20 +183,7 @@ var CloudFunc, exports;
return lShorted;
};
/** Function gets file name and
* if it's bigger the 16 chars
* cut it and adds '..'
* @pName - file name
*/
CloudFunc.getShortedName = function(pName){
return (pName.length > CloudFunc.SHORTNAMELENGTH ?
(pName.substr(pName,
CloudFunc.SHORTNAMELENGTH) + '..'):
pName);
};
/** Функция парсит uid и имена пользователей
* из переданного в строке вычитаного файла /etc/passwd
* и возвращает массив обьектов имён и uid пользователей
@ -442,14 +429,8 @@ var CloudFunc, exports;
(files[i].size === 'dir' ?
'' : ' target="_blank"') +
/* если длина имени файла больше 16 символов
* отрезаем лишнее, оставляя лишь 16,
* и добавляем две точки и тайтл
*/
(files[i].name.length > CloudFunc.SHORTNAMELENGTH ?
' title="' + files[i].name + '">' +
CloudFunc.getShortedName(files[i].name)
: 'draggable=true>' + files[i].name) +
' title="' + files[i].name +'"' +
'draggable=true>' + files[i].name +
"</a>" +
'</span>';
/* если папка - не выводим размер */