Skip to content

Commit 6d26a30

Browse files
committed
chore: format
1 parent 46f169f commit 6d26a30

File tree

2 files changed

+41
-41
lines changed

2 files changed

+41
-41
lines changed

frontend/src/js/core/templating.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export const render = (
237237

238238
if (!dataURIsCommitted[imageHash]) {
239239
const request = new XMLHttpRequest();
240-
request.open("POST", "/api/image-cache", false); // `false` makes the request synchronous
240+
request.open('POST', '/api/image-cache', false); // `false` makes the request synchronous
241241
request.send(JSON.stringify(parent[key]));
242242
}
243243

frontend/src/js/ui/components/config/image.ts

+40-40
Original file line numberDiff line numberDiff line change
@@ -13,45 +13,45 @@ const imageClass = css`
1313
`;
1414

1515
export default {
16-
name: 'Image',
17-
default: () => '!IMAGE',
18-
view: (): m.Component<ConfigProps> => ({
19-
view: ({ attrs }) => [
20-
!attrs.inEdit ? null : m(MiniHeader, 'Default'),
21-
attrs.value && attrs.value.length > 0 && attrs.value.startsWith('data:')
22-
? m(Flex, { items: 'center', justify: 'end' }, [
23-
m(`img.br2.mr2.w-100.${imageClass}`, { src: attrs.value }), //
24-
m(
25-
Icon,
26-
{
27-
icon: 'trash',
28-
size: 4,
29-
className: '.col-error',
30-
onClick: () => {
31-
if (!attrs.onChange) return;
32-
attrs.onChange("");
33-
},
34-
},
35-
'Remove',
36-
)
37-
])
38-
: m(ImageUpload, {
39-
height: 50,
40-
compact: true,
41-
className: '.mb3',
42-
onUpload: (name, image) => {
43-
if (!attrs.onChange) return;
16+
name: 'Image',
17+
default: () => '!IMAGE',
18+
view: (): m.Component<ConfigProps> => ({
19+
view: ({ attrs }) => [
20+
!attrs.inEdit ? null : m(MiniHeader, 'Default'),
21+
attrs.value && attrs.value.length > 0 && attrs.value.startsWith('data:')
22+
? m(Flex, { items: 'center', justify: 'end' }, [
23+
m(`img.br2.mr2.w-100.${imageClass}`, { src: attrs.value }), //
24+
m(
25+
Icon,
26+
{
27+
icon: 'trash',
28+
size: 4,
29+
className: '.col-error',
30+
onClick: () => {
31+
if (!attrs.onChange) return;
32+
attrs.onChange('');
33+
},
34+
},
35+
'Remove',
36+
),
37+
])
38+
: m(ImageUpload, {
39+
height: 50,
40+
compact: true,
41+
className: '.mb3',
42+
onUpload: (name, image) => {
43+
if (!attrs.onChange) return;
4444

45-
m.request({
46-
url: `/api/image-cache`,
47-
method: 'POST',
48-
body: image,
49-
}).then(() => {
50-
if (!attrs.onChange) return;
51-
attrs.onChange(image);
52-
});
53-
},
54-
}),
55-
],
56-
}),
45+
m.request({
46+
url: `/api/image-cache`,
47+
method: 'POST',
48+
body: image,
49+
}).then(() => {
50+
if (!attrs.onChange) return;
51+
attrs.onChange(image);
52+
});
53+
},
54+
}),
55+
],
56+
}),
5757
} as Config;

0 commit comments

Comments
 (0)