Skip to content

Commit

Permalink
Merge pull request #1398 from plone/contentbrowser-keyboard-event
Browse files Browse the repository at this point in the history
`pat-contentbrowser` UI fixes
  • Loading branch information
petschki authored Oct 15, 2024
2 parents f3c5e1a + d086d78 commit ac74024
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/pat/contentbrowser/src/ContentBrowser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
// one level search mode
updatePreview({ data: item });
} else if (item.is_folderish) {
$previewUids = [item.UID];
currentPath.set(item.path);
} else {
const pathParts = item.path.split("/");
Expand Down
16 changes: 9 additions & 7 deletions src/pat/contentbrowser/src/SelectedItems.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@
style="width: {$config.width || 'auto'}"
bind:this={ref}
>
<!-- {maxSelectionsize} -->
<div class="content-browser-selected-items">
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="content-browser-selected-items"
on:click={() => $showContentBrowser = $selectedItems.length ? false : true }>
{#if $selectedItems}
{#each $selectedItems as selItem, i (selItem.UID)}
<div
Expand All @@ -109,10 +111,9 @@
data-uuid={selItem.UID}
>
<div class="item-info">
<!-- svelte-ignore a11y-missing-attribute -->
<button
class="btn btn-link btn-sm link-secondary"
on:click={() => unselectItem(i)}
on:click|stopPropagation={() => unselectItem(i)}
><svg use:resolveIcon={{ iconName: "x-circle" }} /></button
>
<div>
Expand All @@ -131,11 +132,12 @@
<p>{_t("loading selected items")}</p>
{/if}
</div>
<button
class="btn btn-primary"
<!-- svelte-ignore a11y-invalid-attribute -->
<a
class="btn btn-primary" href="#"
style="border-radius:0 var(--bs-border-radius) var(--bs-border-radius) 0"
on:click|preventDefault={() => ($showContentBrowser = true)}
>{_t("Select")}</button
>{_t("Select")}</a
>
</div>
Expand Down

0 comments on commit ac74024

Please sign in to comment.