@@ -10,7 +10,7 @@ export default Component.extend({
1010 onClick ( ) { } ,
1111 onMouseEnter ( ) { } ,
1212
13- linkArgs : computed ( 'result.document' , function ( ) {
13+ linkArgs : computed ( 'result.document.{route,type}' , 'result.model.routingId ', function ( ) {
1414 let args = [ ] ;
1515 let type = this . get ( 'result.document.type' ) ;
1616 if ( type === 'template' ) {
@@ -23,21 +23,21 @@ export default Component.extend({
2323 return args ;
2424 } ) ,
2525
26- icon : computed ( function ( ) {
26+ icon : computed ( 'result.document.type' , function ( ) {
2727 if ( this . get ( 'result.document.type' ) === 'template' ) {
2828 return 'guide' ;
2929 } else {
3030 return 'api-item' ;
3131 }
3232 } ) ,
3333
34- matches : computed ( function ( ) {
34+ matches : computed ( 'query' , 'result.document.{keywords,text}' , 'result.resultInfo.matchData.metadata' , function ( ) {
3535 let metadata = this . get ( 'result.resultInfo.matchData.metadata' ) ;
3636
3737 return Object . keys ( metadata )
3838 . reduce ( ( matches , term ) => {
3939 let match = metadata [ term ] ;
40- let query = this . get ( ' query' ) ;
40+ let query = this . query ;
4141 let normalizedQuery = query . toLowerCase ( ) ;
4242 Object . keys ( match ) . forEach ( ( key ) => {
4343 if ( key === 'text' ) {
@@ -78,7 +78,7 @@ export default Component.extend({
7878 return this . matches [ 0 ] ;
7979 } ) ,
8080
81- highlightedTitle : computed ( 'result.document.title ' , 'query ' , function ( ) {
81+ highlightedTitle : computed ( 'query.length ' , 'result.document.title ' , function ( ) {
8282 let title = this . result . document . title || '' ;
8383 let match = title . match ( new RegExp ( this . query , 'i' ) ) ;
8484
0 commit comments