|
|
|
@ -65,6 +65,7 @@ function save(partID) {
|
|
|
|
|
var partno_v = $('input[name=partno-input]').val();
|
|
|
|
|
var description_v = $('input[name=description-input]').val();
|
|
|
|
|
var datasheet = $('table#details tr#datasheet td input')[0].files;
|
|
|
|
|
var datasheet_url_v = $('input[name=datasheet-url-input]').val();
|
|
|
|
|
if(partno_v.length == 0){
|
|
|
|
|
alert('Please enter a part number.');
|
|
|
|
|
return;
|
|
|
|
@ -89,6 +90,8 @@ function save(partID) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
data.append('datasheet-file', datasheet[0]);
|
|
|
|
|
} else if (datasheet_url_v.length > 0) {
|
|
|
|
|
data.append('datasheet-url', datasheet_url_v);
|
|
|
|
|
}
|
|
|
|
|
data.append('partno', partno_v);
|
|
|
|
|
data.append('location_id', location_id_v)
|
|
|
|
@ -162,8 +165,8 @@ function show_part_info(partID) {
|
|
|
|
|
$('table#details tr#description td input').val(text_filter(data.description));
|
|
|
|
|
container_onchange();
|
|
|
|
|
if (data.datasheet != null) {
|
|
|
|
|
$('tr#datasheet-head').html($('<td>DATASHEET: <a href="parts/getfile/' + data.datasheet + '"><i class="fa fa-file-text" aria-hidden="true"></i></a></td>'));
|
|
|
|
|
$('#datasheet-input').val(data.datasheet);
|
|
|
|
|
$('tr#datasheet-head').html($('<td>DATASHEET: <a href="' + data.datasheet + '"><i class="fa fa-file-text" aria-hidden="true"></i></a></td>'));
|
|
|
|
|
$('input[name=datasheet-url-input]').val(data.datasheet);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
$('tr#datasheet-head td').text('DATASHEET: ');
|
|
|
|
|