mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
moved event.preventDefault() to end of if-codition
This commit is contained in:
parent
0bf0676641
commit
2d36121507
1 changed files with 10 additions and 18 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue