Changed script to accommodate for heavy restyling

master
Davide Bongiovanni 6 years ago
parent 47c25847f0
commit af3d1f3200

@ -16,14 +16,19 @@ function init_edit(partID) {
$('table#details tr#datasheet td input').show();
$('#duplicate-button').closest('div').hide();
$('#delete-button').closest('div').hide();
$('tr#datasheet').show();
$('input[name=notes-input]').show();
$('table#details tr#notes td p').hide();
var newButton = '<div class="round-button-left"><a href="#" onclick="save(' + partID + ')"><i class="fa fa-check" aria-hidden="true"></i></a></div>';
$('.round-button-left').replaceWith(newButton);
// var newButton = '<div class="round-button-left"><a href="#" onclick="save(' + partID + ')"><i class="fa fa-check" aria-hidden="true"></i></a></div>';
// $('.round-button-left').replaceWith(newButton);
$('#edit-button').html('<i class="fa fa-check" aria-hidden="true"></i>');
$('#edit-button').off('click').on('click', function(){
save(partID);
});
}
function new_entry() {
@ -61,9 +66,11 @@ function end_edit() {
$('table#details tr#notes td p').show();
$('#duplicate-button').closest('div').show();
$('#delete-button').closest('div').show();
var newButton = '<div class="round-button-left"><a href="#" id="edit-button"><i class="fa fa-pencil" aria-hidden="true"></i></a></div>';
$('.round-button-left').replaceWith(newButton);
$('#edit-button').html('<i class="fa fa-pencil" aria-hidden="true"></i>');
// var newButton = '<div class="round-button-left"><a href="#" id="edit-button"><i class="fa fa-pencil" aria-hidden="true"></i></a></div>';
// $('.round-button-left').replaceWith(newButton);
}
function save(partID) {
@ -196,7 +203,7 @@ function show_part_info(partID) {
$('tr#datasheet-head td').text('DATASHEET: ');
$('input[name=datasheet-url-input]').val('');
}
$('#edit-button').click(function() {
$('#edit-button').off('click').on('click', function() {
init_edit(partID);
});
$('#delete-button').off('click').on('click', function() {

Loading…
Cancel
Save