|
|
|
@ -200,22 +200,22 @@ function delete_entry(partID) {
|
|
|
|
|
|
|
|
|
|
function show_part_info(partID) {
|
|
|
|
|
$.getJSON('http://127.0.0.1:5000/parts/getpartinfo/' + partID, function(data) {
|
|
|
|
|
$('#block-info').text(text_filter(data.block));
|
|
|
|
|
$('#type-info').text(text_filter(data.type));
|
|
|
|
|
$('#partno-info').text(text_filter(data.partno) + ' ' + text_filter(data.partnoalt) + ' ' + text_filter(data.partnoalt2));
|
|
|
|
|
$('#description-info').text(text_filter(data.description));
|
|
|
|
|
$('#quantity-info').text(text_filter(data.quantity));
|
|
|
|
|
$('#notes-info').text(text_filter(data.notes));
|
|
|
|
|
if (data.datasheet != null)
|
|
|
|
|
$('#datasheet-info').html($('<a href="http://127.0.0.1:5000/parts/getfile/' + data.datasheet.substring(0, data.datasheet.length - 4) + '"><i class="fa fa-file-text" aria-hidden="true"></i></a>'));
|
|
|
|
|
else
|
|
|
|
|
$('#datasheet-info').text(' ');
|
|
|
|
|
$('#edit-button').click(function() {
|
|
|
|
|
init_edit(partID);
|
|
|
|
|
});
|
|
|
|
|
$('#delete-button').click(function() {
|
|
|
|
|
delete_entry(partID);
|
|
|
|
|
});
|
|
|
|
|
$('table#details tr#location td').text(text_filter(data.name)); // name is the location friendly name
|
|
|
|
|
$('table#details tr#partno td').text(text_filter(data.partno));
|
|
|
|
|
$('table#details tr#description td').text(text_filter(data.description));
|
|
|
|
|
// $('#description-info').text(text_filter(data.description));
|
|
|
|
|
// $('#quantity-info').text(text_filter(data.quantity));
|
|
|
|
|
// $('#notes-info').text(text_filter(data.notes));
|
|
|
|
|
// if (data.datasheet != null)
|
|
|
|
|
// $('#datasheet-info').html($('<a href="http://127.0.0.1:5000/parts/getfile/' + data.datasheet.substring(0, data.datasheet.length - 4) + '"><i class="fa fa-file-text" aria-hidden="true"></i></a>'));
|
|
|
|
|
// else
|
|
|
|
|
// $('#datasheet-info').text(' ');
|
|
|
|
|
// $('#edit-button').click(function() {
|
|
|
|
|
// init_edit(partID);
|
|
|
|
|
// });
|
|
|
|
|
// $('#delete-button').click(function() {
|
|
|
|
|
// delete_entry(partID);
|
|
|
|
|
// });
|
|
|
|
|
overlay_in();
|
|
|
|
|
}).fail(function() {
|
|
|
|
|
console.log( "Fetching part info failed" );
|
|
|
|
@ -261,7 +261,7 @@ $(document).ready(function() {
|
|
|
|
|
perform_query();
|
|
|
|
|
});
|
|
|
|
|
$('.checkbox').change( function() {
|
|
|
|
|
if ( !$('#type').is(':checked')
|
|
|
|
|
if ( !$('#location').is(':checked')
|
|
|
|
|
&& !$('#partno').is(':checked')
|
|
|
|
|
&& !$('#description').is(':checked')
|
|
|
|
|
&& !$('#notes').is(':checked'))
|
|
|
|
|