mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-28 22:00:25 -04:00
Don't ask for team again if we already have a child window.
This commit is contained in:
parent
364ff4fc00
commit
f1c8983de2
2 changed files with 8 additions and 1 deletions
app
|
@ -49,7 +49,7 @@ block header
|
|||
|
||||
if level.get('type') === 'ladder'
|
||||
li.dropdown
|
||||
a(data-toggle='dropdown')
|
||||
a(data-toggle='dropdown').play-with-team-parent
|
||||
span.glyphicon-play.glyphicon
|
||||
ul.dropdown-menu
|
||||
li.dropdown-header Play As Which Team?
|
||||
|
|
|
@ -26,6 +26,7 @@ module.exports = class EditorLevelView extends View
|
|||
events:
|
||||
'click #play-button': 'onPlayLevel'
|
||||
'click .play-with-team-button': 'onPlayLevel'
|
||||
'click .play-with-team-parent': 'onPlayLevelTeamSelect'
|
||||
'click #commit-level-start-button': 'startCommittingLevel'
|
||||
'click #fork-level-start-button': 'startForkingLevel'
|
||||
'click #level-history-button': 'showVersionHistory'
|
||||
|
@ -77,6 +78,12 @@ module.exports = class EditorLevelView extends View
|
|||
@listenTo @patchesView, 'accepted-patch', -> location.reload()
|
||||
@$el.find('#level-watch-button').find('> span').toggleClass('secret') if @level.watching()
|
||||
|
||||
onPlayLevelTeamSelect: (e) ->
|
||||
if @childWindow and not @childWindow.closed
|
||||
# We already have a child window open, so we don't need to ask for a team; we'll use its existing team.
|
||||
e.stopImmediatePropagation()
|
||||
@onPlayLevel e
|
||||
|
||||
onPlayLevel: (e) ->
|
||||
team = $(e.target).data('team')
|
||||
sendLevel = =>
|
||||
|
|
Loading…
Add table
Reference in a new issue