1- import Ember from 'ember' ;
21import { inject as service } from '@ember/service' ;
32import { debounce } from '@ember/runloop' ;
43import Component from '@ember/component' ;
54import layout from './template' ;
65import { EKMixin , keyUp , keyDown } from 'ember-keyboard' ;
6+ import { on } from '@ember/object/evented' ;
7+ import { computed } from '@ember/object' ;
78
89export default Component . extend ( EKMixin , {
910 layout,
@@ -42,7 +43,7 @@ export default Component.extend(EKMixin, {
4243 }
4344 } ,
4445
45- searchResults : Ember . computed ( 'rawSearchResults.[]' , function ( ) {
46+ searchResults : computed ( 'rawSearchResults.[]' , function ( ) {
4647 let rawSearchResults = this . get ( 'rawSearchResults' ) ;
4748
4849 if ( rawSearchResults ) {
@@ -59,7 +60,7 @@ export default Component.extend(EKMixin, {
5960 }
6061 } ) ,
6162
62- gotoSelectedItem : Ember . on ( keyUp ( 'Enter' ) , function ( ) {
63+ gotoSelectedItem : on ( keyUp ( 'Enter' ) , function ( ) {
6364 if ( this . get ( 'selectedIndex' ) !== null ) {
6465 let selectedResult = this . get ( 'searchResults' ) [ this . get ( 'selectedIndex' ) ] ;
6566 if ( selectedResult . document . type === 'template' ) {
@@ -72,7 +73,7 @@ export default Component.extend(EKMixin, {
7273 this . clearSearch ( ) ;
7374 } ) ,
7475
75- nextSearchResult : Ember . on ( keyDown ( 'ctrl+KeyN' ) , function ( ) {
76+ nextSearchResult : on ( keyDown ( 'ctrl+KeyN' ) , function ( ) {
7677 let hasSearchResults = this . get ( 'searchResults.length' ) ;
7778 let lastResultIsSelected = ( this . get ( 'selectedIndex' ) + 1 === this . get ( 'searchResults.length' ) ) ;
7879
@@ -81,7 +82,7 @@ export default Component.extend(EKMixin, {
8182 }
8283 } ) ,
8384
84- previousSearchResult : Ember . on ( keyDown ( 'ctrl+KeyP' ) , function ( ) {
85+ previousSearchResult : on ( keyDown ( 'ctrl+KeyP' ) , function ( ) {
8586 let hasSearchResults = this . get ( 'searchResults.length' ) ;
8687 let firstResultIsSelected = ( this . get ( 'selectedIndex' ) === 0 ) ;
8788
@@ -90,11 +91,11 @@ export default Component.extend(EKMixin, {
9091 }
9192 } ) ,
9293
93- focusSearch : Ember . on ( keyUp ( 'Slash' ) , keyUp ( 'KeyS' ) , function ( ) {
94+ focusSearch : on ( keyUp ( 'Slash' ) , keyUp ( 'KeyS' ) , function ( ) {
9495 this . $ ( '.docs-viewer-search__input' ) . focus ( ) ;
9596 } ) ,
9697
97- unfocusSearch : Ember . on ( keyUp ( 'Escape' ) , function ( ) {
98+ unfocusSearch : on ( keyUp ( 'Escape' ) , function ( ) {
9899 this . setProperties ( {
99100 rawSearchResults : null ,
100101 didSearch : false
0 commit comments