mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Ladder view can now be linked to to play against a specific team.
This commit is contained in:
parent
12f1042530
commit
d14f862359
1 changed files with 4 additions and 2 deletions
|
@ -66,6 +66,7 @@ module.exports = class LadderView extends RootView
|
|||
@insertSubView(@ladderTab = new LadderTabView({}, @level, @sessions))
|
||||
@insertSubView(@myMatchesTab = new MyMatchesTabView({}, @level, @sessions))
|
||||
setInterval(@fetchSessionsAndRefreshViews.bind(@), 10000)
|
||||
@showPlayModal(document.location.hash[1..]) if document.location.hash and @sessions.loaded
|
||||
|
||||
fetchSessionsAndRefreshViews: ->
|
||||
@sessions.fetch({"success": @refreshViews})
|
||||
|
@ -112,8 +113,9 @@ module.exports = class LadderView extends RootView
|
|||
$("#simulation-status-text").text @simulationStatus
|
||||
|
||||
onClickPlayButton: (e) ->
|
||||
button = $(e.target).closest('.play-button')
|
||||
teamID = button.data('team')
|
||||
@showPlayModal($(e.target).closest('.play-button').data('team'))
|
||||
|
||||
showPlayModal: (teamID) ->
|
||||
session = (s for s in @sessions.models when s.get('team') is teamID)[0]
|
||||
modal = new LadderPlayModal({}, @level, session, teamID)
|
||||
@openModalView modal
|
||||
|
|
Loading…
Reference in a new issue