Skip to content

Commit

Permalink
Fix interfering multicheckboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Apr 30, 2021
1 parent a21df41 commit 111c18e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PlutoUI"
uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
authors = ["Fons van der Plas <[email protected]>"]
version = "0.7.6"
version = "0.7.7"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
12 changes: 8 additions & 4 deletions assets/multicheckbox.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
const container = (currentScript ? currentScript : this.currentScript)
.previousElementSibling;

const my_id = crypto.getRandomValues(new Uint32Array(1))[0].toString(36)

// Add checkboxes
const inputEls = [];
for (let i = 0; i < labels.length; i++) {
const boxId = `box-${i}`;
const boxId = `${my_id}-box-${i}`;

const item = document.createElement("div");
item.classList.add("multicheckbox");
Expand Down Expand Up @@ -40,17 +42,19 @@ if (includeSelectAll) {
// Add select-all checkbox.
const selectAllItem = document.createElement("div");
selectAllItem.classList.add("multicheckbox");
selectAllItem.classList.add("select-all");
selectAllItem.classList.add(`select-all`);

const selectID = `${my_id}-select-all`

const selectAllInput = document.createElement("input");
selectAllInput.classList.add("multicheckbox");
selectAllInput.type = "checkbox";
selectAllInput.id = "select-all";
selectAllInput.id = selectID;
selectAllItem.appendChild(selectAllInput);

const selectAllLabel = document.createElement("label");
selectAllLabel.classList.add("multicheckbox");
selectAllLabel.htmlFor = "select-all";
selectAllLabel.htmlFor = selectID;
selectAllLabel.innerText = "Select All";
selectAllItem.appendChild(selectAllLabel);

Expand Down

2 comments on commit 111c18e

@fonsp
Copy link
Member Author

@fonsp fonsp commented on 111c18e Apr 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/35718

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.7 -m "<description of version>" 111c18e4fe6108d04b00cb831c75c4684a042cfa
git push origin v0.7.7

Please sign in to comment.