|
29 | 29 | <!-- Visual Area --> |
30 | 30 | <div class="editor-preview md:min-h-auto flex min-h-[45vh] w-full flex-1 flex-col justify-between bg-gray-800 shadow-[inset_0px_4px_3px_0px_black] dark:bg-gray-900 md:w-1/2 md:flex-auto md:grow lg:w-2/3 md:ltr:rounded-se-xl"> |
31 | 31 | <!-- Toolbar --> |
32 | | - <div v-if="isToolbarVisible" class="@container/toolbar dark flex flex-wrap items-center justify-center gap-2 px-2 py-4"> |
| 32 | + <div v-if="showToolbar" class="@container/toolbar dark flex flex-wrap items-center justify-center gap-2 px-2 py-4"> |
33 | 33 | <ItemActions |
34 | 34 | :item="id" |
35 | 35 | :url="actionUrl" |
|
38 | 38 | @completed="actionCompleted" |
39 | 39 | v-slot="{ actions }" |
40 | 40 | > |
41 | | - <ui-button inset size="sm" v-if="isImage && isFocalPointEditorEnabled" @click.prevent="openFocalPointEditor" icon="focus" variant="ghost" class="[&_svg]:!opacity-45" :text="__('Focal Point')" /> |
| 41 | + <ui-button inset size="sm" v-if="asset.isEditable && isImage && isFocalPointEditorEnabled" @click.prevent="openFocalPointEditor" icon="focus" variant="ghost" class="[&_svg]:!opacity-45" :text="__('Focal Point')" /> |
42 | 42 | <ui-button inset size="sm" v-if="asset.can_be_transparent" @click="showCheckerboard = !showCheckerboard" icon="eye" variant="ghost" :class="[showCheckerboard ? '[&_svg]:!opacity-45' : '[&_svg]:!opacity-100']" :text="__('Transparency')" /> |
43 | 43 | <ui-button inset size="sm" v-if="canRunAction('rename_asset')" @click.prevent="runAction(actions, 'rename_asset')" icon="rename" variant="ghost" class="[&_svg]:!opacity-45" :text="__('Rename')" /> |
44 | 44 | <ui-button inset size="sm" v-if="canRunAction('move_asset')" @click.prevent="runAction(actions, 'move_asset')" icon="move-folder" variant="ghost" class="[&_svg]:!opacity-45" :text="__('Move to Folder')" /> |
|
47 | 47 | <ui-button inset size="sm" @click="download" icon="download" variant="ghost" class="[&_svg]:!opacity-45" :text="__('Download')" /> |
48 | 48 | <ui-button inset size="sm" v-if="allowDeleting && canRunAction('delete')" @click="runAction(actions, 'delete')" icon="trash" variant="ghost" class="[&_svg]:!opacity-45" :text="__('Delete')" /> |
49 | 49 |
|
50 | | - <Dropdown class="me-4"> |
| 50 | + <Dropdown class="me-4" v-if="filterForActionsMenu(actions).length"> |
51 | 51 | <DropdownMenu> |
52 | 52 | <DropdownItem |
53 | 53 | v-for="action in filterForActionsMenu(actions)" |
@@ -266,10 +266,6 @@ export default { |
266 | 266 | isFocalPointEditorEnabled() { |
267 | 267 | return Statamic.$config.get('focalPointEditorEnabled'); |
268 | 268 | }, |
269 | | -
|
270 | | - isToolbarVisible() { |
271 | | - return !this.readOnly && this.showToolbar; |
272 | | - }, |
273 | 269 | }, |
274 | 270 |
|
275 | 271 | mounted() { |
|
0 commit comments