mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Do not set campaignIndex for levels except for course campaigns
This commit is contained in:
parent
546598396d
commit
c57fd6f460
1 changed files with 5 additions and 6 deletions
|
@ -154,16 +154,15 @@ module.exports = class CampaignEditorView extends RootView
|
|||
|
||||
propagateCampaignIndexes: ->
|
||||
campaignLevels = $.extend({}, @campaign.get('levels'))
|
||||
|
||||
index = 0
|
||||
for levelOriginal, campaignLevel of campaignLevels
|
||||
level = @levels.findWhere({original: levelOriginal})
|
||||
if level and level.get('campaignIndex') isnt index
|
||||
level.set('campaignIndex', index)
|
||||
if @campaign.get('type') is 'course'
|
||||
level = @levels.findWhere({original: levelOriginal})
|
||||
if level and level.get('campaignIndex') isnt index
|
||||
level.set('campaignIndex', index)
|
||||
campaignLevel.campaignIndex = index
|
||||
index += 1
|
||||
|
||||
@campaign.set('levels', campaignLevels)
|
||||
@campaign.set('levels', campaignLevels)
|
||||
|
||||
onClickPatches: (e) ->
|
||||
@patchesView = @insertSubView(new PatchesView(@campaign), @$el.find('.patches-view'))
|
||||
|
|
Loading…
Reference in a new issue