43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
$(document).ready(function() {
|
|
|
|
$(document).on('click', '.tablePackageList .select_one', function() {
|
|
if ($(this).is(':checked')) {
|
|
$('.generatePacked').removeAttr('disabled');
|
|
}
|
|
let count = 0;
|
|
$('.tablePackageList .select_one').each(function () {
|
|
if ($(this).is(':checked')) {
|
|
count++;
|
|
}
|
|
});
|
|
if (count == 0) {
|
|
$('.generatePacked').attr('disabled', 'disabled');
|
|
} else {
|
|
$('.generatePacked').removeAttr('disabled');
|
|
}
|
|
});
|
|
|
|
$(document).on('click', '.tablePackageList .select_all', function() {
|
|
if ($(this).is(':checked')) {
|
|
$('.generatePacked').removeAttr('disabled');
|
|
} else {
|
|
$('.generatePacked').attr('disabled', 'disabled');
|
|
}
|
|
});
|
|
|
|
$(document).on('click', '.show_products small', function() {
|
|
let show = $(this).parent().data('show');
|
|
if (show == 'off') {
|
|
$(this).text('Ukryj produkty');
|
|
$(this).parent().data('show', 'on');
|
|
$(this).closest('tr').next().show();
|
|
} else {
|
|
$(this).text('Pokaż produkty');
|
|
$(this).parent().data('show', 'off');
|
|
$(this).closest('tr').next().hide();
|
|
}
|
|
|
|
});
|
|
|
|
});
|