@@ -4,10 +4,11 @@ import ColumnsMixin from "../mixins/columns";
44import FilesMixin from "../mixins/files" ;
55import TestFilesMixin from "../mixins/test-files" ;
66import AppBuilderMixin from "../mixins/app-builder" ;
7+ import { keyDown , EKMixin } from 'ember-keyboard' ;
78
8- const { inject, computed, run } = Ember ;
9+ const { inject, computed, run, on } = Ember ;
910
10- export default Ember . Component . extend ( AppBuilderMixin , ColumnsMixin , FilesMixin , TestFilesMixin , {
11+ export default Ember . Component . extend ( AppBuilderMixin , ColumnsMixin , FilesMixin , TestFilesMixin , EKMixin , {
1112 emberCli : inject . service ( ) ,
1213 dependencyResolver : inject . service ( ) ,
1314 notify : inject . service ( ) ,
@@ -24,9 +25,24 @@ export default Ember.Component.extend(AppBuilderMixin, ColumnsMixin, FilesMixin,
2425 isFastBoot : this . get ( 'fastboot.isFastBoot' )
2526 } ) ) ;
2627 this . createColumns ( ) ;
27- this . set ( 'activeEditorCol' , '1' ) ;
28+ this . setProperties ( {
29+ activeEditorCol : '1' ,
30+ keyboardActivated : true
31+ } ) ;
2832 } ,
2933
34+ // eslint-disable-next-line ember/no-on-calls-in-components
35+ onReloadCommand : on ( keyDown ( 'Enter+cmd' ) , function ( ) {
36+ this . send ( 'runNow' ) ;
37+ } ) ,
38+
39+ // eslint-disable-next-line ember/no-on-calls-in-components
40+ onSaveCommand : on ( keyDown ( 'cmd+KeyS' ) , function ( event ) {
41+ this . saveGist ( this . get ( 'model' ) ) ;
42+ this . send ( 'runNow' ) ;
43+ event . preventDefault ( ) ;
44+ } ) ,
45+
3046 /**
3147 * Output from the build, sets the `code` attr on the component
3248 * @type {String }
0 commit comments