User editor, baseURL change, remove octopart autofill
This commit is contained in:
Regular → Executable
Regular → Executable
+11
-1
@@ -213,6 +213,7 @@ 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)
|
||||
@@ -248,7 +249,7 @@ function perform_query() {
|
||||
$('#no-results').animate({opacity:1},2000);
|
||||
console.log( "Query failed" );
|
||||
});
|
||||
|
||||
|
||||
// update URL and history
|
||||
window.history.pushState('searching', '', 'parts?q=' + query)
|
||||
}
|
||||
@@ -306,6 +307,15 @@ $(document).ready(function() {
|
||||
show_part_info(search_params.get('p'));
|
||||
}
|
||||
|
||||
//For linking to a search query or specific part
|
||||
const search_params = new URLSearchParams(window.location.search);
|
||||
if(search_params.has('q')){
|
||||
$('.search-bar').val(search_params.get('q')); perform_query();
|
||||
}
|
||||
if(search_params.has('p')){
|
||||
show_part_info(search_params.get('p'));
|
||||
}
|
||||
|
||||
// $('#partno-input').bind('blur',function() {
|
||||
// if($('#partno-input').val().length > 0){
|
||||
// octopartFetch();
|
||||
|
||||
Regular → Executable
Regular → Executable
Reference in New Issue
Block a user