mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
feature(config) onKey: onChange on Enter
This commit is contained in:
parent
c39e343357
commit
993c59f398
1 changed files with 12 additions and 6 deletions
|
|
@ -141,9 +141,9 @@ var CloudCmd, Util, DOM, io;
|
|||
|
||||
[].forEach.call(inputs, function(input) {
|
||||
Events.addKey(input, onKey)
|
||||
.add('change', input, function(event) {
|
||||
onChange(event.target);
|
||||
});
|
||||
.add('change', input, function(event) {
|
||||
onChange(event.target);
|
||||
});
|
||||
});
|
||||
|
||||
CloudCmd.View.show(Element, {
|
||||
|
|
@ -253,11 +253,17 @@ var CloudCmd, Util, DOM, io;
|
|||
}
|
||||
|
||||
function onKey(event) {
|
||||
var keyCode = event.keyCode,
|
||||
ESC = Key.ESC;
|
||||
var keyCode = event.keyCode;
|
||||
|
||||
if (keyCode === ESC)
|
||||
switch (keyCode) {
|
||||
case Key.ESC:
|
||||
Config.hide();
|
||||
break;
|
||||
|
||||
case Key.ENTER:
|
||||
onChange(event.target);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
init();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue