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

Method addControls

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

Source from the content-addressed store, hash-verified

690 }
691
692 addControls () {
693 this.collapsed = false
694 this.toggle_button = this._createToggleButton()
695
696 /* If it should start collapsed */
697 if (this.options.collapsed) {
698 trigger(this.toggle_button, 'click')
699 }
700
701 /* Collapse button disabled */
702 if (this.schema.options && typeof this.schema.options.disable_collapse !== 'undefined') {
703 if (this.schema.options.disable_collapse) this.toggle_button.style.display = 'none'
704 } else if (this.jsoneditor.options.disable_collapse) {
705 this.toggle_button.style.display = 'none'
706 }
707
708 /* Add "new row" and "delete last" buttons below editor */
709 this.add_row_button = this._createAddRowButton()
710 this.delete_last_row_button = this._createDeleteLastRowButton()
711 this.remove_all_rows_button = this._createRemoveAllRowsButton()
712
713 if (this.tabs) {
714 this.add_row_button.classList.add('je-array-control-btn')
715 this.delete_last_row_button.classList.add('je-array-control-btn')
716 this.remove_all_rows_button.classList.add('je-array-control-btn')
717 }
718 }
719
720 _createToggleButton () {
721 const button = this.getButton('', 'collapse', 'button_collapse')

Callers 1

buildMethod · 0.95

Calls 6

_createToggleButtonMethod · 0.95
_createAddRowButtonMethod · 0.95
triggerFunction · 0.90
addMethod · 0.80

Tested by

no test coverage detected