diff --git a/parts/static/script.js b/parts/static/script.js index 7ad8098..af31969 100644 --- a/parts/static/script.js +++ b/parts/static/script.js @@ -10,6 +10,8 @@ function init_edit(partID) { $('table#details tr#datasheet td input').show(); + $('#duplicate-button').closest('div').hide(); + var datasheet_input = $('') $('#datasheet-info').replaceWith(datasheet_input); @@ -21,9 +23,8 @@ function new_entry() { $('table#details tr#location td p').text(''); $('table#details tr#partno td p').text(''); $('table#details tr#description td p').text(''); - // $('table#details tr#location select').text(''); - $('table#details tr#partno td input').text(''); - $('table#details tr#description td input').text(''); + $('table#details tr#partno td input').val(''); + $('table#details tr#description td input').val(''); init_edit(-1); overlay_in(); } @@ -44,46 +45,21 @@ function end_edit() { $('table#details tr#datasheet td input').hide(); + $('#duplicate-button').closest('div').show(); + var newButton = '
'; $('.round-button-left').replaceWith(newButton); } function save(partID) { - // var block_v = $('#block-input').val(); - // var type_v = $('#type-input').val(); var location_id_v = $('table#details tr#location td select').val(); var partno_v = $('table#details tr#partno td input').val(); var description_v = $('table#details tr#description td input').val(); - // var quantity_v = $('#quantity-input').val(); - // var notes_v = $('#notes-input').val(); var datasheet = $('table#details tr#datasheet td input')[0].files; - // if(! partno_v.match(/^([a-zA-Z0-9]{1,20}\s*){1,3}$/g)) { - // alert('Invalid part number format. Accepted: