diff --git a/parts/static/script.js b/parts/static/script.js index b84fe07..2a47dee 100644 --- a/parts/static/script.js +++ b/parts/static/script.js @@ -170,8 +170,14 @@ function show_part_info(partID) { $.getJSON(rootURL + 'getpartinfo/' + partID, function(data) { $('table#details tr#location td p').text(text_filter(data.location_descriptor)); // name is the location friendly name $('#container-dropdown').val(data.container_id); - container_onchange(); - $('#location-dropdown').val(data.location_id); + $('img#map').attr('src', 'parts/map/' + data.container_id); + $('#location-dropdown').empty(); + $.getJSON('parts/getlocationsInContainer/' + data.container_id, function(json) { + $.each(data, function(loc_id, loc_name) { + $('#location-dropdown').append(''); + }); + $('#location-dropdown').val(data.location_id); + }); $('table#details tr#partno td p').text(text_filter(data.partno)); $('table#details tr#partno td input').val(text_filter(data.partno)); $('table#details tr#description td p').text(text_filter(data.description));