From c57fd6f460a0485c8bce342fd44f286f8e7d497c Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Wed, 8 Jun 2016 15:48:22 -0700 Subject: [PATCH] Do not set campaignIndex for levels except for course campaigns --- app/views/editor/campaign/CampaignEditorView.coffee | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/editor/campaign/CampaignEditorView.coffee b/app/views/editor/campaign/CampaignEditorView.coffee index 17b182574..4cff9c845 100644 --- a/app/views/editor/campaign/CampaignEditorView.coffee +++ b/app/views/editor/campaign/CampaignEditorView.coffee @@ -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'))