Skip to content

Commit

Permalink
Merge pull request #6 from UofS-Pulse-Binfo/ambiguous-checkbox
Browse files Browse the repository at this point in the history
Replaces ambiguous checkbox
  • Loading branch information
laceysanderson authored Jan 24, 2023
2 parents 83fa9fb + 8b1f4cc commit 819d227
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion includes/helium_exporter.form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function helium_exporter_form($form, &$form_state) {
<strong>%s:</strong> %d <span class="helium-exporter-selections"></span>
<span class="helium-exporter-field-options">
<a href="#" alt="Search a value" title="Search a value">Search</a> |
<a class="helium-exporter-item-check" href="#" alt="Select or deselect all options" title="Select or deselect all options">All</a>
<input type="checkbox">&nbsp;Select All
</span>
<div class="helium-exporter-custom-checkbox-search">
<input type="text" value="">
Expand Down
16 changes: 5 additions & 11 deletions theme/script/script-helium-exporter-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,11 @@
//

// Add event listener to select and deselect option.
$('.helium-exporter-field-options a:last-child')
$('.helium-exporter-field-options input[type="checkbox"]')
.click(function(e) {
e.preventDefault();
// Current item selected.
var element = $(this);

// Identify which custom checkbox set to affect event
// and reference components to use.
var customCheckboxSet = customCheckboxGetSet(element);
Expand All @@ -113,8 +112,8 @@
// Set state of item (check or uncheck).
// Elements: class to remove, class to add.
var checkClass = [];

if (element.hasClass(checkState.on)) {
if (element.is(':checked')) {
// Item select all. OFF to ON (all).
checkClass.push(checkState.on, checkState.off);

Expand All @@ -126,12 +125,7 @@
checkClass.push(checkState.off, checkState.on);
checkTable[ customCheckboxSet ] = [];
}

// Apply class to show state of item.
element
.removeClass(checkClass[0])
.addClass(checkClass[1]);


items
.removeClass(checkClass[1])
.addClass(checkClass[0]);
Expand Down

0 comments on commit 819d227

Please sign in to comment.