fixed bug in setCurentFile

This commit is contained in:
coderaiser 2012-09-06 08:51:12 -04:00
parent 7634365a95
commit d748bf3b06
2 changed files with 13 additions and 21 deletions

View file

@ -652,24 +652,16 @@ CloudClient.Util = (function(){
}
var lCurrentFileWas = this.getCurrentFile();
var lClass = pCurrentFile.className;
if (lClass !== 'path' &&
lClass !== 'fm_header'){
if(lCurrentFileWas)
this.unSetCurrentFile(lCurrentFileWas);
pCurrentFile.className = CloudCommander.CURRENT_FILE;
} else {
this.addCloudStatus({
code : -2,
msg : 'Error pCurrentFile in' +
'setCurrentFile' +
'could not be ' +
'path or fm_header'
});
if (pCurrentFile.className === 'path')
pCurrentFile = pCurrentFile.nextSibling;
if (pCurrentFile.className == 'fm_header')
pCurrentFile = pCurrentFile.nextSibling;
if(lCurrentFileWas)
this.unSetCurrentFile(lCurrentFileWas);
lRet_b = false;
}
pCurrentFile.className = CloudCommander.CURRENT_FILE;
return lRet_b;
};

View file

@ -196,8 +196,8 @@ var CloudCommander;
* пропускаем путь и заголовки столбиков
* выделяем верхий файл
*/
lCurrentFile = lCurrentFile
.parentElement.children[2];
lCurrentFile = lCurrentFile.
parentElement.firstChild;
Util.setCurrentFile(lCurrentFile);
@ -212,8 +212,8 @@ var CloudCommander;
*/
else if( event.keyCode === lKEY.END){
/* выделяем самый нижний файл */
lCurrentFile = lCurrentFile
.parentElement.lastElementChild;
lCurrentFile = lCurrentFile.
parentElement.lastElementChild;
Util.setCurrentFile(lCurrentFile);