-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix styling and toggle all in element slideout container
- Loading branch information
Showing
6 changed files
with
30 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
/* globals */ | ||
|
||
.content-pane #sitecopy { | ||
.content-pane .sitecopy { | ||
margin-top: 50px; | ||
} | ||
|
||
/* elements */ | ||
|
||
.details #sitecopy-options { | ||
.details .sitecopy-options { | ||
padding-bottom: 1px; | ||
} | ||
|
||
.details #sitecopy-options .field { | ||
.details .sitecopy-options .field { | ||
margin: 24px 0; | ||
} | ||
} | ||
|
||
.slideout-container .sitecopy-options { | ||
padding-bottom: 1px; | ||
} | ||
|
||
.slideout-container .sitecopy-options .field { | ||
margin: 24px 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
function toggleSitecopyTargets(source) { | ||
const checkboxes = document.getElementsByName('sitecopy[targets][]'); | ||
const sitecopyDiv = source.closest('.sitecopy'); | ||
const checkboxes = sitecopyDiv.querySelectorAll('.sitecopy-options input[type="checkbox"]'); | ||
const isChecked = source.checked; | ||
|
||
for (let i = 1, n = checkboxes.length; i < n; i++) { | ||
checkboxes[i].checked = isChecked; | ||
} | ||
} | ||
|
||
function updateSitecopyToggleAll() { | ||
const toggleAll = document.getElementById('sitecopy-toggle-all'); | ||
function updateSitecopyToggleAll(source) { | ||
const sitecopyDiv = source.closest('.sitecopy'); | ||
const toggleAll = sitecopyDiv.querySelector('[id$="sitecopy-toggle-all"]'); | ||
|
||
|
||
if (toggleAll) { | ||
const checkboxes = document.getElementsByName('sitecopy[targets][]'); | ||
const checkboxes = sitecopyDiv.querySelectorAll('.sitecopy-options input[type="checkbox"]'); | ||
toggleAll.checked = Array.from(checkboxes).every((checkbox) => checkbox.checked); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters