moved event.preventDefault() to end of if-codition

This commit is contained in:
coderaiser 2012-07-30 03:00:54 -04:00
parent 0bf0676641
commit 2d36121507

View file

@ -22,9 +22,7 @@ CloudCommander.keyBinding=(function(){
/* if f3 pressed */
else if(event.keyCode===114){
if (typeof CloudCommander.Viewer === 'function'){
CloudCommander.Viewer();
event.preventDefault();
CloudCommander.Viewer();
}
}
/* навигация по таблице файлов*/
@ -54,9 +52,7 @@ CloudCommander.keyBinding=(function(){
lTop %
(CloudCommander.HEIGHT -
CloudCommander.HEIGHT/10) < 70 &&
lCurrentFile.parentElement.scrollByLines(-2);
event.preventDefault();
lCurrentFile.parentElement.scrollByLines(-2);
}
}
/* если нажали клавишу в низ*/
@ -84,9 +80,7 @@ CloudCommander.keyBinding=(function(){
lMod < 70 && lMod > 50 &&
console.log(lCurrentFile
.parentElement
.scrollByLines(2) || '!');
event.preventDefault();
.scrollByLines(2) || '!');
}
}
/* если нажали клавишу page up или Home
@ -194,9 +188,7 @@ CloudCommander.keyBinding=(function(){
break;
}
}
}
event.preventDefault();//запрет на дальнейшее действие
}
}
}
/* если нажали <ctrl>+d чистим кэш */
@ -207,9 +199,7 @@ CloudCommander.keyBinding=(function(){
console.log('press <alt>+q to remove all key-handlers');
var lClearCache=document.getElementById('clear-cache');
if(lClearCache && lClearCache.onclick)lClearCache.onclick();
event.preventDefault();//запрет на дальнейшее действие
if(lClearCache && lClearCache.onclick)lClearCache.onclick();
}
/* если нажали <alt>+q
* убираем все обработчики
@ -243,9 +233,11 @@ CloudCommander.keyBinding=(function(){
console.log('<ctrl>+r reload key-handerl - set');
console.log('<ctrl>+s clear cache key-handler - set');
console.log('press <alt>+q to remove them');
}
return false;
}
event.preventDefault();//запрет на дальнейшее действие
return false;
};
/* добавляем обработчик клавишь */
if(document.addEventListener)