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

Method build

src/editors/array.js:90–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88 }
89
90 build () {
91 if (!this.options.compact) {
92 this.header = document.createElement('span')
93 this.header.textContent = this.getTitle()
94 this.title = this.theme.getHeader(this.header, this.getPathDepth())
95 this.container.appendChild(this.title)
96 if (this.options.infoText) {
97 this.infoButton = this.theme.getInfoButton(this.translateProperty(this.options.infoText))
98 this.container.appendChild(this.infoButton)
99 }
100 this.title_controls = this.theme.getHeaderButtonHolder()
101 this.title.appendChild(this.title_controls)
102 if (this.schema.description) {
103 this.description = this.theme.getDescription(this.translateProperty(this.schema.description))
104 this.container.appendChild(this.description)
105 }
106 this.error_holder = document.createElement('div')
107 this.container.appendChild(this.error_holder)
108
109 if (this.schema.format === 'tabs-top') {
110 this.controls = this.theme.getHeaderButtonHolder()
111 this.title.appendChild(this.controls)
112 this.tabs_holder = this.theme.getTopTabHolder(this.getValidId(this.getItemTitle()))
113 this.container.appendChild(this.tabs_holder)
114 this.row_holder = this.theme.getTopTabContentHolder(this.tabs_holder)
115
116 this.active_tab = null
117 } else if (this.schema.format === 'tabs') {
118 this.controls = this.theme.getHeaderButtonHolder()
119 this.title.appendChild(this.controls)
120 this.tabs_holder = this.theme.getTabHolder(this.getValidId(this.getItemTitle()))
121 this.container.appendChild(this.tabs_holder)
122 this.row_holder = this.theme.getTabContentHolder(this.tabs_holder)
123
124 this.active_tab = null
125 } else {
126 this.panel = this.theme.getIndentedPanel()
127 this.container.appendChild(this.panel)
128 this.row_holder = document.createElement('div')
129 this.panel.appendChild(this.row_holder)
130 this.controls = this.theme.getButtonHolder()
131 if (this.array_controls_top) {
132 this.title.appendChild(this.controls)
133 } else {
134 this.panel.appendChild(this.controls)
135 }
136 }
137 } else {
138 /* compact mode */
139 this.title = this.theme.getHeader('', this.getPathDepth())
140 this.container.appendChild(this.title)
141 this.panel = this.theme.getIndentedPanel()
142 this.container.appendChild(this.panel)
143 this.title_controls = this.theme.getHeaderButtonHolder()
144 this.title.appendChild(this.title_controls)
145 this.controls = this.theme.getHeaderButtonHolder()
146 this.title.appendChild(this.controls)
147 this.row_holder = document.createElement('div')

Callers 1

getElementEditorMethod · 0.45

Calls 15

getItemTitleMethod · 0.95
addControlsMethod · 0.95
getPathDepthMethod · 0.80
getValidIdMethod · 0.80
getTitleMethod · 0.45
getHeaderMethod · 0.45
getInfoButtonMethod · 0.45
getHeaderButtonHolderMethod · 0.45
getDescriptionMethod · 0.45
getTopTabHolderMethod · 0.45
getTabHolderMethod · 0.45

Tested by

no test coverage detected