minor changes

This commit is contained in:
coderaiser 2012-08-07 11:10:10 -04:00
parent fb9f8dd449
commit 368767eb8e
2 changed files with 11 additions and 34 deletions

View file

@ -13,12 +13,12 @@ CloudCommander.Editor.CodeMirror.load = (function(pParent){
/* function shows editor */
var createEditorDiv = function(){
if (!pParent.getById('CloudEditor')) {
var lFM = document.getElementById('fm');
var lFM = pParent.getById('fm');
if(lFM)
pParent.anyload({
name : 'div',
id : 'CloudEditor',
element : lFM
parent : lFM
});
else
console.log('Error. Something went wrong FM not found');

View file

@ -92,53 +92,30 @@ CloudCommander.keyBinding=(function(){
/* 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);
*/
lCurrentFile.previousSibling
.scrollIntoViewIfNeeded();
}
}
/* если нажали клавишу в низ*/
else if(event.keyCode===40){
/* получаем выдленный файл*/
lCurrentFile = Util.getCurrentFile();
/* если ненайдены выделенные файлы - выходим*/
if(!lCurrentFile)return;
/* если это не последняя строка */
if(lCurrentFile.nextSibling){
/* убираем с него выделение */
lCurrentFile.className='';
/* выделяем следующую строку*/
lCurrentFile.nextSibling.className = CloudCommander.CURRENT_FILE;
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) || '!');
*/
lCurrentFile.nextSibling.scrollIntoViewIfNeeded();
}
}
/* если нажали клавишу Home