Added record of partID when modifying part info
This commit is contained in:
+3
-1
@@ -140,7 +140,6 @@ function text_filter(string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function show_part_info(partID) {
|
function show_part_info(partID) {
|
||||||
//var partID = $(this).attr('part-id');
|
|
||||||
$.getJSON('https://www.elab.kth.se/parts/getpartinfo/' + partID, function(data) {
|
$.getJSON('https://www.elab.kth.se/parts/getpartinfo/' + partID, function(data) {
|
||||||
$('#block-info').text(text_filter(data.block));
|
$('#block-info').text(text_filter(data.block));
|
||||||
$('#partno-info').text(text_filter(data.partno) + ' ' + text_filter(data.partnoalt) + ' ' + text_filter(data.partnoalt2));
|
$('#partno-info').text(text_filter(data.partno) + ' ' + text_filter(data.partnoalt) + ' ' + text_filter(data.partnoalt2));
|
||||||
@@ -151,6 +150,9 @@ function show_part_info(partID) {
|
|||||||
$('#datasheet-info').text('<a href="https://www.elab.kth.se/parts/getfile/' + data.datasheet + '"><i class="fa fa-file-text" aria-hidden="true"></i></a>');
|
$('#datasheet-info').text('<a href="https://www.elab.kth.se/parts/getfile/' + data.datasheet + '"><i class="fa fa-file-text" aria-hidden="true"></i></a>');
|
||||||
else
|
else
|
||||||
$('#datasheet-info').text(' ');
|
$('#datasheet-info').text(' ');
|
||||||
|
$('#edit-button').on('click', function() {
|
||||||
|
init_edit(partID);
|
||||||
|
});
|
||||||
overlay_in();
|
overlay_in();
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
console.log( "Fetching part info failed" );
|
console.log( "Fetching part info failed" );
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
<div class="details-content"><p id="datasheet-info"></p></div>
|
<div class="details-content"><p id="datasheet-info"></p></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="round-button"><a href="#" onclick="init_edit()"><i class="fa fa-pencil" aria-hidden="true"></i></a></div>
|
<div class="round-button"><a href="#" id="edit_button"><i class="fa fa-pencil" aria-hidden="true"></i></a></div>
|
||||||
<div class="small-square-button"><a href="#" onclick="overlay_out()"><i class="fa fa-times" aria-hidden="true"></i></a></div>
|
<div class="small-square-button"><a href="#" onclick="overlay_out()"><i class="fa fa-times" aria-hidden="true"></i></a></div>
|
||||||
<!--<h2 class="card-id"></h2>
|
<!--<h2 class="card-id"></h2>
|
||||||
<input type="text" name="name" placeholder="Name" id="name"><br><br>
|
<input type="text" name="name" placeholder="Name" id="name"><br><br>
|
||||||
|
|||||||
Reference in New Issue
Block a user