Added order position deletion; added fontawesome pro
This commit is contained in:
@@ -410,15 +410,27 @@
|
||||
$includes_external_product = true;
|
||||
}
|
||||
?>
|
||||
<div class="row product-container">
|
||||
<div class="row product-container" id="position-<?=$product->id?>">
|
||||
<input type="hidden" name="products[<?=$product->id?>][delete]" id="products-<?=$product->id?>-delete" value="0" />
|
||||
<div class="col-md-1 product-<?=$product->id?>">
|
||||
<!-- pos number -->
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="pos-<?=$product->id?>">Position</label>
|
||||
<input type="number" class="form-control" name="products[<?=$product->id?>][pos]" id="pos-<?=$product->id?>" value="<?=$product->pos?>" placeholder="Position" />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- pos number -->
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="pos-<?=$product->id?>">Position</label>
|
||||
<input type="number" class="form-control" name="products[<?=$product->id?>][pos]" id="pos-<?=$product->id?>" value="<?=$product->pos?>" placeholder="Position" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 delete-button-container">
|
||||
<i class="btn btn-outline-danger fas fa-trash-can pointer" style="font-size: 1.5em" onclick="toggleDeletePos(<?=$product->id?>)"></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-11">
|
||||
<!-- product lines -->
|
||||
<div class="row">
|
||||
@@ -1170,6 +1182,37 @@
|
||||
<?php endif; ?>
|
||||
});
|
||||
|
||||
|
||||
function toggleDeletePos(id) {
|
||||
if($('#products-' + id + '-delete').val() == "0") {
|
||||
$('#position-' + id).addClass('deleted text-white');
|
||||
$('#position-' + id + ' .delete-button-container i').removeClass("btn-outline-danger fa-trash-can").addClass("btn-danger fa-trash-can-slash");
|
||||
$('#position-' + id + ' .delete-button-container').append('<p class="text-white font-weight-bold">Wird gelöscht!</p>');
|
||||
//$('#position-' + id + ' .delete-button-container i').removeClass("fa-trash-can").addClass("fa-trash-can-slash");
|
||||
$('#products-' + id + '-delete').val(1);
|
||||
|
||||
$('#position-' + id).each(function() {
|
||||
$(this).find('input').attr("readonly", true).addClass("text-danger");
|
||||
$(this).find('select').attr("readonly", true).addClass("text-danger");
|
||||
$(this).find('textarea').attr("readonly", true).addClass("text-danger");
|
||||
});
|
||||
|
||||
} else {
|
||||
$('#products-' + id + '-delete').val(0);
|
||||
//$('#position-' + id + ' .delete-button-container i').removeClass("fa-trash-can-slash").addClass("fa-trash-can");
|
||||
$('#position-' + id + ' .delete-button-container').html('<i class="btn btn-outline-danger fas fa-trash-can pointer" style="font-size: 1.5em" onclick="toggleDeletePos(' + id + ')"></i>');
|
||||
//$('#position-' + id + ' .delete-button-container i').removeClass("btn-outline-white fa-trash-can-slash").addClass("text-danger fa-trash-can");
|
||||
$('#position-' + id).removeClass('text-white deleted');
|
||||
|
||||
$('#position-' + id).each(function() {
|
||||
$(this).find('input').attr("readonly", false).removeClass("text-danger");
|
||||
$(this).find('select').attr("readonly", false).removeClass("text-danger");
|
||||
$(this).find('textarea').attr("readonly", false).removeClass("text-danger");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../")."/footer.php"); ?>
|
||||
|
||||
Reference in New Issue
Block a user