MCPcopy Index your code
hub / github.com/json-editor/json-editor / getOptInCheckbox

Method getOptInCheckbox

src/theme.js:26–43  ·  view source on GitHub ↗
(formname)

Source from the content-addressed store, hash-verified

24 }
25
26 getOptInCheckbox (formname) {
27 const container = document.createElement('span')
28
29 const label = this.getHiddenLabel(formname + ' opt-in')
30 label.setAttribute('for', formname + '-opt-in')
31 label.textContent = formname + '-opt-in'
32
33 const checkbox = document.createElement('input')
34 checkbox.setAttribute('type', 'checkbox')
35 checkbox.setAttribute('style', 'margin: 0 10px 0 0;')
36 checkbox.setAttribute('id', formname + '-opt-in')
37 checkbox.classList.add('json-editor-opt-in')
38
39 container.appendChild(checkbox)
40 container.appendChild(label)
41
42 return { label, checkbox, container }
43 }
44
45 getOptInSwitch (formname) {
46 return this.getOptInCheckbox()

Callers 2

getOptInSwitchMethod · 0.95
setOptInCheckboxMethod · 0.80

Calls 2

getHiddenLabelMethod · 0.95
addMethod · 0.80

Tested by

no test coverage detected