File tree Expand file tree Collapse file tree 4 files changed +16
-14
lines changed Expand file tree Collapse file tree 4 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 1- import $ from 'jquery' ;
21import { inject as service } from '@ember/service' ;
32import Component from '@ember/component' ;
43import layout from './template' ;
@@ -45,11 +44,11 @@ export default Component.extend(EKMixin, {
4544 } ,
4645
4746 didInsertElement ( ) {
48- $ ( 'body' ) . addClass ( 'docs-viewer--showing' ) ;
47+ document . querySelector ( 'body' ) . classList . add ( 'docs-viewer--showing' ) ;
4948 } ,
5049
5150 willDestroyElement ( ) {
52- $ ( 'body' ) . removeClass ( 'docs-viewer--showing' ) ;
51+ document . querySelector ( 'body' ) . classList . remove ( 'docs-viewer--showing' ) ;
5352 this . get ( 'docsRoutes' ) . resetState ( ) ;
5453 } ,
5554
@@ -66,7 +65,7 @@ export default Component.extend(EKMixin, {
6665 } ) ,
6766
6867 searchIsNotFocused ( ) {
69- return ! this . $ ( '.docs-viewer-search__input' ) . is ( ':focus' ) ;
68+ return ! this . element . querySelector ( '.docs-viewer-search__input' ) === document . activeElement ;
7069 }
7170
7271} ) ;
Original file line number Diff line number Diff line change @@ -96,15 +96,15 @@ export default Component.extend(EKMixin, {
9696 } ) ,
9797
9898 focusSearch : on ( keyUp ( 'Slash' ) , keyUp ( 'KeyS' ) , function ( ) {
99- this . $ ( '.docs-viewer-search__input' ) . focus ( ) ;
99+ this . element . querySelector ( '.docs-viewer-search__input' ) . focus ( ) ;
100100 } ) ,
101101
102102 unfocusSearch : on ( keyUp ( 'Escape' ) , function ( ) {
103103 this . setProperties ( {
104104 rawSearchResults : null ,
105105 didSearch : false
106106 } ) ;
107- this . $ ( '.docs-viewer-search__input' ) . blur ( ) ;
107+ this . element . querySelector ( '.docs-viewer-search__input' ) . blur ( ) ;
108108 } ) ,
109109
110110 clearSearch ( ) {
@@ -114,8 +114,9 @@ export default Component.extend(EKMixin, {
114114 rawSearchResults : null ,
115115 query : null
116116 } ) ;
117- this . $ ( '.docs-viewer-search__input' ) . val ( '' ) ;
118- this . $ ( '.docs-viewer-search__input' ) . blur ( ) ;
117+ let input = this . element . querySelector ( '.docs-viewer-search__input' ) ;
118+ input . value = '' ;
119+ input . blur ( ) ;
119120 } ,
120121
121122 actions : {
Original file line number Diff line number Diff line change 11import Service from '@ember/service' ;
22import { getOwner } from '@ember/application' ;
33import { computed } from '@ember/object' ;
4- import { resolve } from 'rsvp' ;
5- import $ from 'jquery' ;
64import lunr from 'lunr' ;
75
86const { Index, Query } = lunr ;
@@ -74,7 +72,8 @@ export default Service.extend({
7472
7573 loadSearchIndex ( ) {
7674 if ( ! this . _searchIndex ) {
77- this . _searchIndex = resolve ( $ . get ( this . get ( '_indexURL' ) ) )
75+ this . _searchIndex = fetch ( this . get ( '_indexURL' ) )
76+ . then ( res => res . json ( ) )
7877 . then ( json => {
7978 return {
8079 index : Index . load ( json . index ) ,
Original file line number Diff line number Diff line change @@ -19,23 +19,26 @@ module.exports = function() {
1919 name : 'ember-lts-2.12' ,
2020 npm : {
2121 devDependencies : {
22- 'ember-source' : '~2.12.0'
22+ 'ember-source' : '~2.12.0' ,
23+ 'ember-native-dom-event-dispatcher' : '~0.6.4'
2324 }
2425 }
2526 } ,
2627 {
2728 name : 'ember-lts-2.16' ,
2829 npm : {
2930 devDependencies : {
30- 'ember-source' : '~2.16.0'
31+ 'ember-source' : '~2.16.0' ,
32+ 'ember-native-dom-event-dispatcher' : '~0.6.4'
3133 }
3234 }
3335 } ,
3436 {
3537 name : 'ember-lts-2.18' ,
3638 npm : {
3739 devDependencies : {
38- 'ember-source' : '~2.18.0'
40+ 'ember-source' : '~2.18.0' ,
41+ 'ember-native-dom-event-dispatcher' : '~0.6.4'
3942 }
4043 }
4144 } ,
You can’t perform that action at this time.
0 commit comments