moved calling api scrollIntoViewIfNeeded to setCurrentFile

This commit is contained in:
coderaiser 2012-09-12 03:23:34 -04:00
parent 55f1b25ca6
commit 4e04e4954f
2 changed files with 14 additions and 18 deletions

View file

@ -661,7 +661,10 @@ CloudClient.Util = (function(){
if(lCurrentFileWas)
this.unSetCurrentFile(lCurrentFileWas);
pCurrentFile.className = CloudCommander.CURRENT_FILE;
pCurrentFile.className = CloudCommander.CURRENT_FILE;
/* scrolling to current file */
Util.scrollIntoViewIfNeeded(pCurrentFile);
return lRet_b;
};

View file

@ -160,10 +160,7 @@ var CloudCommander;
lCurrentFile = lCurrentFile.previousSibling;
if(lCurrentFile){
/* выделяем предыдущую строку*/
Util.setCurrentFile(lCurrentFile);
/* scrolling to current file*/
Util.scrollIntoViewIfNeeded(lCurrentFile);
Util.setCurrentFile(lCurrentFile);
}
event.preventDefault();//запрет на дальнейшее действие
@ -179,9 +176,6 @@ var CloudCommander;
if(lCurrentFile){
/* выделяем следующую строку*/
Util.setCurrentFile(lCurrentFile);
/* scrolling to current file*/
Util.scrollIntoViewIfNeeded(lCurrentFile);
event.preventDefault();//запрет на дальнейшее действие
}
@ -199,10 +193,10 @@ var CloudCommander;
lCurrentFile = lCurrentFile.
parentElement.firstChild;
Util.setCurrentFile(lCurrentFile);
/* move scrollbar to top */
lCurrentFile.scrollIntoView();
/* set current file and
* move scrollbar to top
*/
Util.setCurrentFile(lCurrentFile);
event.preventDefault();//запрет на дальнейшее действие
}
@ -215,12 +209,11 @@ var CloudCommander;
lCurrentFile = lCurrentFile.
parentElement.lastElementChild;
Util.setCurrentFile(lCurrentFile);
/* move scrollbar to bottom*/
lCurrentFile.scrollIntoView();
event.preventDefault();//запрет на дальнейшее действие
/* set current file and
* move scrollbar to bottom
*/
Util.setCurrentFile(lCurrentFile);
event.preventDefault();//запрет на дальнейшее действие
}
/* если нажали клавишу page down