1
0
Fork 0

Cook field labels

Dieser Commit ist enthalten in:
Angus McLeod 2018-05-13 15:46:02 +10:00
Ursprung 5e936036e6
Commit b73b39370f
3 geänderte Dateien mit 12 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -1,6 +1,6 @@
<label for={{field.id}}>
{{#if field.label}}
<span class='label-value'>{{field.label}}</span>
<span class='label-value'>{{{field.label}}}</span>
{{/if}}
</label>

Datei anzeigen

@ -125,8 +125,12 @@
flex-flow: wrap;
align-items: center;
.field-label {
.label-value {
width: 100%;
p {
margin: 0;
}
}
.field-image {

Datei anzeigen

@ -28,12 +28,10 @@ end
attr_accessor :dropdown_none
def initialize(attrs)
attrs = attrs || {}
@attrs = attrs || {}
@id = attrs[:id]
@type = attrs[:type]
@required = !!attrs[:required]
@label = attrs[:label]
@description = attrs[:description]
@image = attrs[:image]
@key = attrs[:key]
@ -42,6 +40,10 @@ end
@choices = []
@dropdown_none = attrs[:dropdown_none]
end
def label
@label ||= PrettyText.cook(@attrs[:label], keep_emoji_images: true)
end
end
::Wizard::Choice.class_eval do
@ -54,7 +56,7 @@ end
end
def label
@label ||= PrettyText.cook(@opts[:label], keep_emoji_images: true, postProcessTag: '<div>')
@label ||= PrettyText.cook(@opts[:label], keep_emoji_images: true)
end
end