()
| 80 | } |
| 81 | |
| 82 | update() { |
| 83 | const active = this.names[this.index]; |
| 84 | |
| 85 | this.events.emit('update', { active, index: this.index, target: this }); |
| 86 | |
| 87 | if (this.callback) { |
| 88 | this.callback(active, this); |
| 89 | } |
| 90 | |
| 91 | const target = this.items[this.index]; |
| 92 | const direction = this.active > this.index ? 1 : -1; |
| 93 | |
| 94 | this.active = this.index; |
| 95 | |
| 96 | if (target && !target.active) { |
| 97 | target.activate(direction); |
| 98 | } |
| 99 | |
| 100 | this.items.forEach(item => { |
| 101 | if (item !== target && item.active) { |
| 102 | item.deactivate(direction); |
| 103 | } |
| 104 | }); |
| 105 | } |
| 106 | |
| 107 | animateIn() { |
| 108 | this.items.forEach((item, i) => item.animateIn(i * 200)); |
no test coverage detected