119119 @if ($this instanceof \Filament\Resources\Pages\ EditRecord || $this instanceof \Filament\Resources\Pages\ CreateRecord )
120120 <x-filament::button color =" primary" size =" sm" class =" w-full flex items-center justify-center space-x-2"
121121 x-on:click ="
122- $dispatch('set-media-picker-model', {
123- modelId: {{ $getRecord ()?-> id ?? 0 } } ,
124- modelClass: '{{ $getRecord () ? addslashes ($getRecord ():: class ) : addslashes ($this -> getResource ():: getModel ()) } } '
125- });
126- $dispatch('open-modal', { id: 'mediaPickerModal' });
127- " >
122+ $dispatch('set-media-picker-model', {
123+ modelId: {{ $getRecord ()?-> id ?? 0 } } ,
124+ modelClass: '{{ $getRecord () ? addslashes ($getRecord ():: class ) : addslashes ($this -> getResource ():: getModel ()) } } '
125+ });
126+ $dispatch('open-modal', { id: 'mediaPickerModal' });
127+ " >
128128 <span >{{ __ (' media::fields.select_media' ) } } </span >
129129 </x-filament::button >
130130 @endif
@@ -141,11 +141,13 @@ class="relative group bg-white rounded-lg shadow hover:shadow-md transition-shad
141141 <div >
142142 <template x-if =" media.mime_type && media.mime_type.startsWith('image/')" >
143143 <img :src =" media . url" :alt =" media . name"
144- class =" w-full h-32 object-cover rounded-t-lg" />
144+ class =" w-full h-32 object-cover rounded-t-lg cursor-pointer"
145+ x-on:click =" window.open(media.url, '_blank')" />
145146 </template >
146147
147148 <template x-if =" media.mime_type && !media.mime_type.startsWith('image/')" >
148- <div class =" flex flex-col justify-between items-center w-full h-32 mt-3" >
149+ <div class =" flex flex-col justify-between items-center w-full h-32 mt-3 cursor-pointer"
150+ x-on:click =" window.open(media.url, '_blank')" >
149151 <img :src =" $el . dataset . baseUrl + getIconForMimeType(media . mime_type)"
150152 data-base-url =" {{ asset (' ' ) } }" class =" w-16 h-16" />
151153 <div class =" text-xs text-gray-700 w-full mt-2 overflow-hidden text-ellipsis whitespace-normal break-words px-2"
0 commit comments