File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
assets/javascripts/_modules Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1616 var results
1717 var query
1818 var maxSearchEntries = 20
19+ var searchIndexPath
1920
2021 this . start = function start ( $element ) {
2122 $searchForm = $element . find ( 'form' )
2526 $searchResults = $searchResultsWrapper . find ( '.search-results__content' )
2627 $searchResultsTitle = $searchResultsWrapper . find ( '.search-results__title' )
2728 $searchHelp = $ ( '#search-help' )
29+ searchIndexPath = $element . data ( 'searchIndexPath' )
2830
2931 changeSearchAction ( )
3032 changeSearchLabel ( )
4951 this . downloadSearchIndex = function downloadSearchIndex ( ) {
5052 updateTitle ( 'Loading search results' )
5153 $ . ajax ( {
52- url : '/search.json' ,
54+ url : searchIndexPath ,
5355 cache : true ,
5456 method : 'GET' ,
5557 success : function ( data ) {
Original file line number Diff line number Diff line change 11<% if config[:tech_docs][:enable_search] %>
2- <div class ="search " data-module ="search ">
2+ <div class ="search " data-module ="search " data-search-index-path =" <%= search_index_path %> " >
33 < form action ="https://www.google.co.uk/search " method ="get " role ="search " class ="search__form govuk-!-margin-bottom-4 ">
44 < input type ="hidden " name ="as_sitesearch " value ="<%= config [ :tech_docs ] [ :host ] %> "/>
55 < label class ="govuk-label search__label " for ="search " aria-hidden ="true ">
You can’t perform that action at this time.
0 commit comments