| 386 | } |
| 387 | |
| 388 | onClickSpectateButton (e) { |
| 389 | e.preventDefault() |
| 390 | e.stopImmediatePropagation() |
| 391 | const humanSession = this.ladderTab.spectateTargets != null ? this.ladderTab.spectateTargets.humans : undefined |
| 392 | const ogreSession = this.ladderTab.spectateTargets != null ? this.ladderTab.spectateTargets.ogres : undefined |
| 393 | let url = `/play/spectate/${this.level.get('slug')}?` |
| 394 | if (humanSession && ogreSession) { url += `session-one=${humanSession}&session-two=${ogreSession}` } |
| 395 | if (this.league) { url += '&league=' + this.league.id } |
| 396 | if (key.command) { url += '&autoplay=false' } |
| 397 | if (this.tournamentState === 'ended') { url += '&tournament=' + this.tournamentId } |
| 398 | return window.open(url, key.command ? '_blank' : 'spectate') // New tab for spectating specific matches |
| 399 | } |
| 400 | // Backbone.Mediator.publish 'router:navigate', route: url |
| 401 | |
| 402 | onClickSimulateAllButton (e) { |