Skip to content

Commit a1027bf

Browse files
authored
Merge pull request #397 from mathilde-marchand/issue-388
Prevent uncheck if only one base layer is checked
2 parents efc8c9e + fa2b6fc commit a1027bf

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/mv.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,12 @@ var mv = (function () {
321321
$("#frm-bl").append(html);
322322
$("#frm-bl-visible").append(html2);
323323
$(".bl." + classe + " input").bind("change", function (e) {
324+
var checkbox = $(e.currentTarget);
325+
var allChecked = $(".bl." + classe + " input:checked");
326+
if (!checkbox.prop("checked") && allChecked.length === 0) {
327+
checkbox.prop("checked", true);
328+
return;
329+
}
324330
var id = $(this).parent().parent().attr("data-layerid");
325331
var value = $(e.currentTarget).prop("checked");
326332
var select = $("#frm-bl-visible");

0 commit comments

Comments
 (0)