|
|
|
@ -215,8 +215,19 @@ function show_part_info(partID) {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// update URL and history
|
|
|
|
|
var query = $('.search-bar').val();
|
|
|
|
|
window.history.pushState('searching', '', 'parts?q=' + query + '&p=' + partID)
|
|
|
|
|
update_url(partID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function update_url(partID){
|
|
|
|
|
params = {}
|
|
|
|
|
// If there is a seach bar, take its content
|
|
|
|
|
if($('.search-bar').length){
|
|
|
|
|
params['q'] = $('.search-bar').val();
|
|
|
|
|
}
|
|
|
|
|
if(partID != 0){
|
|
|
|
|
params['p'] = partID
|
|
|
|
|
}
|
|
|
|
|
window.history.pushState('searching', '', 'parts?' + jQuery.param(params));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function perform_query() {
|
|
|
|
@ -250,8 +261,7 @@ function perform_query() {
|
|
|
|
|
console.log( "Query failed" );
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// update URL and history
|
|
|
|
|
window.history.pushState('searching', '', 'parts?q=' + query)
|
|
|
|
|
update_url(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function container_onchange() {
|
|
|
|
|