()
| 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') |
no test coverage detected