diff --git a/parts/static/script.js b/parts/static/script.js index b2141e7..d3a25be 100644 --- a/parts/static/script.js +++ b/parts/static/script.js @@ -213,6 +213,9 @@ function show_part_info(partID) { }).fail(function() { console.log( "Fetching part info failed" ); }); + // update URL and history + var query = $('.search-bar').val(); + window.history.pushState('searching', '', 'parts?q=' + query + '&p=' + partID) } function perform_query() { @@ -245,6 +248,9 @@ function perform_query() { $('#no-results').animate({opacity:1},2000); console.log( "Query failed" ); }); + + // update URL and history + window.history.pushState('searching', '', 'parts?q=' + query) } function container_onchange() {