Fixed syntax error. Minor refactoring.

pull/3/head
Davide Bongiovanni 6 years ago
parent 4c78533976
commit e9b670bea8

@ -55,9 +55,9 @@ function end_edit() {
} }
function save(partID) { function save(partID) {
var location_id_v = $('table#details tr#location td select').val(); var location_id_v = $('#location-dropdown').val();
var partno_v = $('table#details tr#partno td input').val(); var partno_v = $('input[name=partno-input]').val();
var description_v = $('table#details tr#description td input').val(); var description_v = $('input[name=description-input]').val();
var datasheet = $('table#details tr#datasheet td input')[0].files; var datasheet = $('table#details tr#datasheet td input')[0].files;
if(partno_v.length == 0){ if(partno_v.length == 0){
alert('Please enter a part number.'); alert('Please enter a part number.');
@ -151,7 +151,7 @@ function show_part_info(partID) {
$('table#details tr#description td input').val(text_filter(data.description)); $('table#details tr#description td input').val(text_filter(data.description));
container_onchange(); container_onchange();
if (data.datasheet != null) { if (data.datasheet != null) {
$('tr#datasheet-head').html($('<td>DATASHEET: <a href="' data.datasheet '"><i class="fa fa-file-text" aria-hidden="true"></i></a></td>')); $('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); $('#datasheet-input').val(data.datasheet);
} }
else else

Loading…
Cancel
Save