mirror of https://github.com/quatalog/site.git
Update search_helper.js
This commit is contained in:
parent
c84ba3d7b2
commit
1d25abc922
|
@ -26,9 +26,8 @@ const search_helper = function(event) {
|
|||
|
||||
// if it is, redirect to it
|
||||
if(course_exists) {
|
||||
const loc = window.location.pathname;
|
||||
// handle both homepage and courses pages
|
||||
if(loc.substring(0,loc.lastIndexOf('/')) != "/courses") {
|
||||
if(window.location.pathname.split("/").slice(-2,-1)[0] != "courses") {
|
||||
location.href = "courses/"+code_str;
|
||||
} else {
|
||||
location.href = code_str;
|
||||
|
|
Loading…
Reference in New Issue