Skip to content

Commit

Permalink
Fix: make multi-select key configurable for windows users
Browse files Browse the repository at this point in the history
  • Loading branch information
awcodes committed Feb 20, 2024
1 parent 7e7b035 commit 0c49bce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions config/curator.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@
'should_preserve_filenames' => false,
'should_register_navigation' => true,
'visibility' => 'public',
'multi_select_key' => 'metaKey',
];
2 changes: 1 addition & 1 deletion resources/lang/en/views.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
'download' => 'Download',
'remove' => 'Remove',
'deselect_all' => 'Deselect All',
'add_multiple_file' => 'Cmd + Click to select multiple files.',
'add_multiple_file' => ':key + Click to select multiple files.',
],
'curation' => [
'heading' => 'Curating',
Expand Down
8 changes: 6 additions & 2 deletions resources/views/components/modals/curator-panel.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
handleItemClick: function (mediaId = null, event) {
if (! mediaId) return;
if ($wire.isMultiple && event && event.metaKey) {
if ($wire.isMultiple && event && event.{{ config('curator.multi_select_key') }}) {
if (this.isSelected(mediaId)) {
let toRemove = Object.values($wire.selected).find(obj => obj.id == mediaId)
$wire.removeFromSelection(toRemove.id);
Expand Down Expand Up @@ -57,7 +57,11 @@ class="curator-panel h-full absolute inset-0 flex flex-col"
</x-filament::button>
@endif
@if ($isMultiple)
<p class="text-xs">{{ trans('curator::views.panel.add_multiple_file') }}</p>
@if (config('curator.multi_select_key') === 'metaKey')
<p class="text-xs">{{ trans('curator::views.panel.add_multiple_file', ['key' => 'Cmd']) }}</p>
@else
<p class="text-xs">{{ trans('curator::views.panel.add_multiple_file', ['key' => config('curator.multi_select_key')]) }}</p>
@endif
@endif
</div>
<label class="border border-gray-300 dark:border-gray-700 rounded-md relative flex items-center">
Expand Down

0 comments on commit 0c49bce

Please sign in to comment.