Skip to content

Commit

Permalink
Update courses.html
Browse files Browse the repository at this point in the history
  • Loading branch information
qwqtw committed Nov 20, 2023
1 parent 119d9f3 commit 6cad67f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lms/templates/courseware/courses.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@

<div id="discovery-message" class="search-status-label"></div>
<!-- <span id="searchQuery"></span> -->
<span class="query" data-type="search_query"></span>
<div class="search-query-display">
<span id="searchQueryDisplay"></span> <!-- This will display the search query -->
</div>
</div>
</div>

Expand Down Expand Up @@ -299,11 +301,12 @@ <h2 class="header-search-facets">${_('Refine Your Search')}</h2>

<script>
document.addEventListener('DOMContentLoaded', (event) => {
var searchQuery = getParameterByName('search_query'); // Get the search query
if (searchQuery) {
document.getElementById('searchQuery').textContent = searchQuery;
}
var searchQuery = getParameterByName('search_query'); // Get the search query
if (searchQuery) {
document.getElementById('searchQueryDisplay').textContent = searchQuery;
}
});


function getParameterByName(name, url = window.location.href) {
name = name.replace(/[\[\]]/g, '\\$&');
Expand Down

0 comments on commit 6cad67f

Please sign in to comment.