File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
core/client/app/components/modals Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 11/* global key */
22import Ember from 'ember' ;
33
4- const { Component, on , run} = Ember ;
4+ const { Component, run} = Ember ;
55
66export default Component . extend ( {
77 tagName : 'section' ,
88 classNames : 'modal-content' ,
99
1010 _previousKeymasterScope : null ,
1111
12- setupShortcuts : on ( 'didInsertElement' , function ( ) {
12+ _setupShortcuts ( ) {
1313 run ( function ( ) {
1414 document . activeElement . blur ( ) ;
1515 } ) ;
@@ -24,14 +24,24 @@ export default Component.extend({
2424 } ) ;
2525
2626 key . setScope ( 'modal' ) ;
27- } ) ,
27+ } ,
2828
29- removeShortcuts : on ( 'willDestroyElement' , function ( ) {
29+ _removeShortcuts ( ) {
3030 key . unbind ( 'enter' , 'modal' ) ;
3131 key . unbind ( 'escape' , 'modal' ) ;
3232
3333 key . setScope ( this . _previousKeymasterScope ) ;
34- } ) ,
34+ } ,
35+
36+ didInsertElement ( ) {
37+ this . _super ( ...arguments ) ;
38+ this . _setupShortcuts ( ) ;
39+ } ,
40+
41+ willDestroyElement ( ) {
42+ this . _super ( ...arguments ) ;
43+ this . _removeShortcuts ( ) ;
44+ } ,
3545
3646 actions : {
3747 confirm ( ) {
You can’t perform that action at this time.
0 commit comments