Skip to content

Commit ceb4e3f

Browse files
committed
es lint stuff
1 parent 99cb6ec commit ceb4e3f

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

assets/src/js/admin/form-editor/field-forms.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ forms.choice = function (config) {
4848
}
4949

5050
if (config.type !== 'checkbox') {
51-
visibleRows.push(rows.useParagraphs(config))
51+
visibleRows.push(rows.useParagraphs(config))
5252
}
5353

5454
if (config.type === 'select' || config.type === 'radio') {

assets/src/js/admin/form-editor/field-generator.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,21 @@ function generate (config) {
158158
const isNested = !['checkbox', 'radio'].includes(config.type)
159159
const field = (generators[config.type] || generators.default)(config)
160160
const hasLabel = config.label.length > 0 && config.showLabel
161-
162-
const content = config.type === 'terms-checkbox' ? field :
163-
isNested ? (hasLabel ? m('label', [config.label, field]) : field) :
164-
m('fieldset', [hasLabel ? m('legend', config.label) : '', field])
165-
161+
162+
const content = config.type === 'terms-checkbox'
163+
? field
164+
: isNested
165+
? (hasLabel
166+
? m('label', [config.label, field])
167+
: field)
168+
: m('fieldset', [hasLabel
169+
? m('legend', config.label)
170+
: '', field])
171+
166172
const htmlTemplate = (config.wrap && isNested) ? m('p', content) : content
167173
const vdom = document.createElement('div')
168174
m.render(vdom, htmlTemplate)
169-
175+
170176
return htmlutil.prettyPrint(vdom.innerHTML).replace(/<\/label>/g, '\n</label>') + '\n'
171177
}
172178

0 commit comments

Comments
 (0)