mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
added event listener on f4 key pressed
This commit is contained in:
parent
4da252c441
commit
f2cc685d87
1 changed files with 23 additions and 1 deletions
|
|
@ -58,6 +58,9 @@ CloudCommander.Editor.CloudMirror = { load: (function(){
|
|||
}
|
||||
}),
|
||||
show : (function(){
|
||||
/* if CloudEditor is not loaded - loading him */
|
||||
document.getElementById('CloudEditor') ||
|
||||
this.load();
|
||||
/* removing keyBinding if set */
|
||||
CloudCommander.keyBinded = false;
|
||||
left.className = 'panel hidden';
|
||||
|
|
@ -72,4 +75,23 @@ CloudCommander.Editor.CloudMirror = { load: (function(){
|
|||
CloudEditor.className='hidden';
|
||||
left.className = 'panel';
|
||||
})
|
||||
};
|
||||
};
|
||||
CloudCommander.Editor.Keys = (function(){
|
||||
"use strict";
|
||||
var key_event=function(event){
|
||||
/* если клавиши можно обрабатывать*/
|
||||
if(CloudCommander.keyBinded){
|
||||
/* if f4 pressed */
|
||||
if(event.keyCode===115){
|
||||
CloudCommander.Edititor.CloudMirror.show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/* добавляем обработчик клавишь */
|
||||
if(document.addEventListener)
|
||||
document.addEventListener('exec_editor', key_event,false);
|
||||
else document.onkeypress=key_event;
|
||||
/* клавиши назначены*/
|
||||
CloudCommander.keyBinded=true;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue