Skip to content

Commit 058a83b

Browse files
Add back certain functionality of ActionInput.vue
I forgot why I changed this to be honest. Signed-off-by: Marcel Robitaille <[email protected]>
1 parent 6044ec2 commit 058a83b

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/components/SimpleActionInput.vue

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@
2828
-->
2929

3030
<template>
31-
<li class="action">
31+
<li class="action" :class="{ 'action--disabled': disabled }">
3232
<span class="action-input">
3333
<slot name="icon">
34-
<span :class="icon" class="action-input__icon" />
34+
<span
35+
:class="[isIconUrl ? 'action-input__icon--url' : icon]"
36+
:style="{
37+
backgroundImage: isIconUrl ? `url(${icon})` : null,
38+
}"
39+
class="action-input__icon"
40+
/>
3541
</slot>
3642
<form
3743
ref="form"
@@ -92,6 +98,13 @@ const ActionGlobalMixin = {
9298
},
9399

94100
computed: {
101+
isIconUrl() {
102+
try {
103+
return new URL(this.icon)
104+
} catch (error) {
105+
return false
106+
}
107+
},
95108
isLongText() {
96109
return this.text && this.text.trim().length > 20
97110
},
@@ -426,7 +439,6 @@ textarea {
426439

427440
// long text area
428441
p {
429-
430442
// in case there are no spaces like long email addresses
431443
overflow: hidden;
432444
max-width: 220px;

0 commit comments

Comments
 (0)