|
|
@ -215,8 +215,19 @@ function show_part_info(partID) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// update URL and history
|
|
|
|
// update URL and history
|
|
|
|
var query = $('.search-bar').val();
|
|
|
|
update_url(partID);
|
|
|
|
window.history.pushState('searching', '', 'parts?q=' + query + '&p=' + 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() {
|
|
|
|
function perform_query() {
|
|
|
@ -250,8 +261,7 @@ function perform_query() {
|
|
|
|
console.log( "Query failed" );
|
|
|
|
console.log( "Query failed" );
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// update URL and history
|
|
|
|
update_url(0);
|
|
|
|
window.history.pushState('searching', '', 'parts?q=' + query)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function container_onchange() {
|
|
|
|
function container_onchange() {
|
|
|
|