misc: hide remove button when a block has a single line (#73137) #710

Merged
fpeters merged 1 commits from wip/73137-hide-single-block-removal-button into main 2023-10-02 10:00:09 +02:00
2 changed files with 8 additions and 0 deletions

View File

@ -2462,6 +2462,11 @@ div.timetable-widget {
content: "\f1f8"; // trash
}
}
&-single {
.remove-button {
visibility: hidden;
}
}
}
.pk-blocks-zebra {

View File

@ -728,6 +728,9 @@ $(function() {
$('.BlockSubWidget button.remove-button').each(function(i, elem) {
if ($(this).parents('.BlockWidget').find('.BlockSubWidget').length == 1) {
$(this).prop('disabled', true);
$(this).parents('.BlockWidget').addClass('wcs-block-with-remove-button-single');
} else {
$(this).parents('.BlockWidget').removeClass('wcs-block-with-remove-button-single');
}
});
}