(cue, contentOptions)
| 24608 | } |
| 24609 | // todo: move to keyword particle class? |
| 24610 | toggle(cue, contentOptions) { |
| 24611 | const currentParticle = this.getParticle(cue) |
| 24612 | if (!contentOptions) return currentParticle ? currentParticle.unmountAndDestroy() : this.appendLine(cue) |
| 24613 | const currentContent = currentParticle === undefined ? undefined : currentParticle.content |
| 24614 | const index = contentOptions.indexOf(currentContent) |
| 24615 | const newContent = index === -1 || index + 1 === contentOptions.length ? contentOptions[0] : contentOptions[index + 1] |
| 24616 | this.delete(cue) |
| 24617 | if (newContent) this.touchParticle(cue).setContent(newContent) |
| 24618 | return newContent |
| 24619 | } |
| 24620 | isMounted() { |
| 24621 | return !!this._htmlStumpParticle |
| 24622 | } |
no test coverage detected