mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
added moving scrolling by cursor ability
This commit is contained in:
parent
5515cdf11c
commit
fb9f8dd449
2 changed files with 28 additions and 15 deletions
|
|
@ -8,6 +8,7 @@ End buttons pressed.
|
|||
* Added ability to move with Page Up and Page Down
|
||||
buttons.
|
||||
|
||||
* Added moving scrolling by cursor ability.
|
||||
|
||||
2012.08.06, Version 0.1.5
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ CloudCommander.keyBinding=(function(){
|
|||
|
||||
/* если ненайдены выделенные файлы - выходим*/
|
||||
if(!lCurrentFile) return;
|
||||
|
||||
|
||||
/* если это строка существет и
|
||||
* если она не заголовок
|
||||
* файловой таблицы
|
||||
|
|
@ -87,17 +87,24 @@ CloudCommander.keyBinding=(function(){
|
|||
/* убираем выделение с текущего элемента */
|
||||
lCurrentFile.className='';
|
||||
/* и выделяем предыдущую строку*/
|
||||
lCurrentFile.previousSibling.className = CloudCommander.CURRENT_FILE;
|
||||
lCurrentFile.previousSibling.className =
|
||||
CloudCommander.CURRENT_FILE;
|
||||
|
||||
/* scrolling to current file*/
|
||||
if(lCurrentFile.previousSibling)
|
||||
lCurrentFile.previousSibling.scrollIntoViewIfNeeded();
|
||||
|
||||
/* if we on the top of
|
||||
* the screan then
|
||||
* moving down the scroolbar
|
||||
*/
|
||||
lTop = lCurrentFile.previousSibling.offsetTop;
|
||||
lTop %
|
||||
(CloudCommander.HEIGHT -
|
||||
CloudCommander.HEIGHT/10) < 70 &&
|
||||
lCurrentFile.parentElement.scrollByLines(-2);
|
||||
/*
|
||||
lTop = lCurrentFile.previousSibling.offsetTop;
|
||||
lTop %
|
||||
(CloudCommander.HEIGHT -
|
||||
CloudCommander.HEIGHT/10) < 70 &&
|
||||
lCurrentFile.parentElement.scrollByLines(-2);
|
||||
*/
|
||||
}
|
||||
}
|
||||
/* если нажали клавишу в низ*/
|
||||
|
|
@ -115,18 +122,23 @@ CloudCommander.keyBinding=(function(){
|
|||
/* выделяем следующую строку*/
|
||||
lCurrentFile.nextSibling.className = CloudCommander.CURRENT_FILE;
|
||||
|
||||
/* scrolling to current file*/
|
||||
lCurrentFile.scrollIntoViewIfNeeded();
|
||||
|
||||
/* 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) || '!');
|
||||
/*
|
||||
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) || '!');
|
||||
*/
|
||||
}
|
||||
}
|
||||
/* если нажали клавишу Home
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue