Skip to content

Commit

Permalink
Added toggle all to collectionlink with multiple items
Browse files Browse the repository at this point in the history
  • Loading branch information
flommy committed Mar 21, 2023
1 parent 850d405 commit ec1b6b2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/Collections/assets/field-collectionlink.tag
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
<table class="uk-table uk-table-tabbed uk-table-striped" if="{ modalOpen && entries.length }">
<thead>
<tr>
<th></th>
<th>
<input if="{opts.multiple}" class="uk-checkbox" type="checkbox" onclick="{toggleAll}"/>
</th>
<th class="uk-text-small" each="{field,idx in fields}">
<a class="uk-link-muted { parent.sort[field.name] ? 'uk-text-primary':'' }" onclick="{ parent.updatesort }" data-sort="{ field.name }">

Expand Down Expand Up @@ -460,6 +462,10 @@
}
}
}

toggleAll(e) {
App.$(e.target).parents("table").find("tr>td input" + (e.target.checked ? ":not(:checked)" : ":checked")).click();
}

getDisplay(link) {

Expand Down

0 comments on commit ec1b6b2

Please sign in to comment.