* Add a button before another button
(before: string, button: MenuButton)
| 48 | * Add a button before another button |
| 49 | */ |
| 50 | static addButtonBefore (before: string, button: MenuButton): void { |
| 51 | const index = this.buttons().findIndex((b: MenuButton) => b.string === before); |
| 52 | const buttons = [...this.buttons()]; |
| 53 | |
| 54 | if (index > -1) { |
| 55 | buttons.splice(index, 0, button); |
| 56 | |
| 57 | this.engine.configuration(this.tag, { |
| 58 | buttons |
| 59 | }); |
| 60 | |
| 61 | this.onConfigurationUpdate(); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Remove a button by its string identifier |
nothing calls this directly
no test coverage detected