2018-05-25 20:33:22 +00:00
|
|
|
import Ember from 'ember';
|
|
|
|
import keys from 'vault/lib/keycodes';
|
|
|
|
|
|
|
|
export default Ember.Component.extend({
|
|
|
|
onExecuteCommand() {},
|
|
|
|
onFullscreen() {},
|
|
|
|
onValueUpdate() {},
|
|
|
|
onShiftCommand() {},
|
|
|
|
value: null,
|
|
|
|
isFullscreen: null,
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
handleKeyUp(event) {
|
|
|
|
const keyCode = event.keyCode;
|
|
|
|
switch (keyCode) {
|
|
|
|
case keys.ENTER:
|
|
|
|
this.get('onExecuteCommand')(event.target.value);
|
|
|
|
break;
|
|
|
|
case keys.UP:
|
|
|
|
case keys.DOWN:
|
|
|
|
this.get('onShiftCommand')(keyCode);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
this.get('onValueUpdate')(event.target.value);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
fullscreen() {
|
|
|
|
this.get('onFullscreen')();
|
2018-05-29 14:14:31 +00:00
|
|
|
},
|
2018-05-25 20:33:22 +00:00
|
|
|
},
|
|
|
|
});
|