Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit e869c15

Browse files
committed
localize, set active
1 parent 61dd571 commit e869c15

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/packages/media/media/modals/image-cropper-editor/components/image-cropper-editor-field.element.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import type { UmbImageCropperElement } from '../../../components/input-image-cropper/image-cropper.element.js';
21
import type {
32
UmbImageCropperCrop,
43
UmbImageCropperCrops,
54
UmbImageCropperFocalPoint,
65
UmbImageCropperPropertyEditorValue,
7-
} from './types.js';
6+
} from '../../../components/index.js';
7+
import type { UmbImageCropperElement } from '../../../components/input-image-cropper/image-cropper.element.js';
88
import { css, customElement, html, property, repeat, state, when } from '@umbraco-cms/backoffice/external/lit';
99
import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';
1010
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
1111

12+
/** TODO Do we want to combine this with the original image-cropper-field element? Element is very similar, but with a few UI changes... */
1213
@customElement('umb-image-cropper-editor-field')
1314
export class UmbImageCropperEditorFieldElement extends UmbLitElement {
1415
@property({ attribute: false })
@@ -170,14 +171,15 @@ export class UmbImageCropperEditorFieldElement extends UmbLitElement {
170171
return html` <uui-menu-item
171172
id="reset-current-crop"
172173
@click=${this.#resetCurrentCrop}
173-
?current=${!this.currentCrop}
174-
label="Media"></uui-menu-item>
174+
?active=${!this.currentCrop}
175+
label=${this.localize.term('general_media')}></uui-menu-item>
176+
175177
${repeat(
176178
this.crops,
177179
(crop) => crop.alias + JSON.stringify(crop.coordinates),
178180
(crop) =>
179181
html` <umb-image-cropper-preview
180-
?current=${this.currentCrop?.alias === crop.alias}
182+
?active=${this.currentCrop?.alias === crop.alias}
181183
@click=${() => this.#onCropClick(crop)}
182184
.crop=${crop}
183185
.focalPoint=${this.focalPoint}
@@ -215,6 +217,8 @@ export class UmbImageCropperEditorFieldElement extends UmbLitElement {
215217
216218
#reset-current-crop {
217219
--uui-menu-item-flat-structure: 1;
220+
--uui-menu-item-border-radius: var(--uui-border-radius);
221+
border-radius: var(--uui-border-radius);
218222
width: 100%;
219223
background-color: var(--uui-color-surface);
220224
}
@@ -224,9 +228,9 @@ export class UmbImageCropperEditorFieldElement extends UmbLitElement {
224228
flex: 1;
225229
}
226230
227-
[current],
228-
#reset-current-crop[current] {
229-
background-color: var(--uui-color-surface-alt);
231+
#reset-current-crop[active],
232+
[active] {
233+
background-color: var(--uui-color-current);
230234
}
231235
232236
umb-image-cropper-focus-setter {

0 commit comments

Comments
 (0)