File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
src/lib/components/v2/projects/datasets Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 436436 throw await getAlertErrorFromResponse (response);
437437 }
438438 }
439+
440+ /**
441+ * @param {string} attributeKey
442+ */
443+ function toggleAll (attributeKey ) {
444+ const selector = attributesSelectors[attributeKey];
445+ const values = imagePage .attributes [attributeKey];
446+ if (! selector || ! values) {
447+ return ;
448+ }
449+ if (selector .getSelected ().length === values .length ) {
450+ selector .setSelected ([]);
451+ } else {
452+ selector .setSelected (values .map ((v ) => v .toString ()));
453+ }
454+ }
439455< / script>
440456
441457{#if ! showTable}
476492 < label for = " attribute-{getIdFromValue(attributeKey)}" >
477493 {attributeKey}
478494 < / label>
495+ < button
496+ class = " ps-0 btn btn-link"
497+ on: click= {() => toggleAll (attributeKey)}
498+ title= " Toggle all"
499+ >
500+ < i class = " bi bi-check-all" / >
501+ < / button>
479502 < / th>
480503 {/ each}
481504 {#each imagePage .types as typeKey}
You can’t perform that action at this time.
0 commit comments