mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
minor changes
This commit is contained in:
parent
8dc8f77952
commit
cb5bf132dd
1 changed files with 22 additions and 6 deletions
|
|
@ -4,7 +4,7 @@ CloudCommander.keyBinding=(function(){
|
|||
"use strict";
|
||||
var key_event=function(event){
|
||||
var lCurrentFile;
|
||||
var lName;
|
||||
var lName, lTop;
|
||||
/* если клавиши можно обрабатывать*/
|
||||
if(CloudCommander.keyBinded){
|
||||
/* если нажали таб:
|
||||
|
|
@ -38,13 +38,16 @@ CloudCommander.keyBinding=(function(){
|
|||
/* и выделяем предыдущую строку*/
|
||||
lCurrentFile.previousSibling.className = CloudCommander.CURRENT_FILE;
|
||||
|
||||
/* if we on the bootom of
|
||||
/* if we on the top of
|
||||
* the screan then
|
||||
* moving down the scroolbar
|
||||
*/
|
||||
var lTop = lCurrentFile.previousSibling.offsetTop;
|
||||
lTop%CloudCommander.HEIGHT < 10 &&
|
||||
lCurrentFile.parentElement.scrollBy(2);
|
||||
lTop = lCurrentFile.previousSibling.offsetTop;
|
||||
console.log(lTop);
|
||||
lTop %
|
||||
(CloudCommander.HEIGHT -
|
||||
CloudCommander.HEIGHT/10) < 70 &&
|
||||
lCurrentFile.parentElement.scrollByLines(-2);
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
|
|
@ -62,7 +65,20 @@ CloudCommander.keyBinding=(function(){
|
|||
lCurrentFile.className='';
|
||||
/* выделяем следующую строку*/
|
||||
lCurrentFile.nextSibling.className = CloudCommander.CURRENT_FILE;
|
||||
console.log(lCurrentFile.nextSibling.offsetTop);
|
||||
|
||||
/* if we on the bottom of
|
||||
* the screan then
|
||||
* moving down the scroolbar
|
||||
*/
|
||||
lTop = lCurrentFile.previousSibling.offsetTop;
|
||||
var lHeight = CloudCommander.HEIGHT;
|
||||
var lMod = lTop % (lHeight - lHeight/10) < 70;
|
||||
lTop > (lHeight/10) &&
|
||||
lMod < 70 && lMod > 50 &&
|
||||
console.log(lCurrentFile
|
||||
.parentElement
|
||||
.scrollByLines(2) || '!');
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue