From ed222338e740d2ba9a52c01ec1663e8bdc79528c Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Wed, 7 May 2014 16:24:13 -0700 Subject: [PATCH] Fixed #892 by having the components tab reload whenever it's opened. --- app/templates/editor/level/edit.jade | 2 +- app/views/editor/level/components_tab_view.coffee | 5 ++--- app/views/editor/level/edit.coffee | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/templates/editor/level/edit.jade b/app/templates/editor/level/edit.jade index 415ff9e20..c2dfbac6f 100644 --- a/app/templates/editor/level/edit.jade +++ b/app/templates/editor/level/edit.jade @@ -24,7 +24,7 @@ block header li a(href="#editor-level-settings-tab-view", data-toggle="tab", data-i18n="editor.level_tab_settings") Settings li - a(href="#editor-level-components-tab-view", data-toggle="tab", data-i18n="editor.level_tab_components") Components + a(href="#editor-level-components-tab-view", data-toggle="tab", data-i18n="editor.level_tab_components")#components-tab Components li a(href="#editor-level-systems-tab-view", data-toggle="tab", data-i18n="editor.level_tab_systems") Systems li diff --git a/app/views/editor/level/components_tab_view.coffee b/app/views/editor/level/components_tab_view.coffee index aadf30b1f..a0fe32f94 100644 --- a/app/views/editor/level/components_tab_view.coffee +++ b/app/views/editor/level/components_tab_view.coffee @@ -14,7 +14,6 @@ module.exports = class ComponentsTabView extends View className: 'tab-pane' subscriptions: - 'level-thangs-changed': 'onLevelThangsChanged' 'edit-level-component': 'editLevelComponent' 'level-component-edited': 'onLevelComponentEdited' 'level-component-editing-ended': 'onLevelComponentEditingEnded' @@ -24,8 +23,8 @@ module.exports = class ComponentsTabView extends View 'click #create-new-component-button-no-select': 'createNewLevelComponent' onLoaded: -> - onLevelThangsChanged: (e) -> - thangsData = e.thangsData + + refreshLevelThangsTreema: (thangsData) -> presentComponents = {} for thang in thangsData for component in thang.components diff --git a/app/views/editor/level/edit.coffee b/app/views/editor/level/edit.coffee index 24dd13b10..c97be9459 100644 --- a/app/views/editor/level/edit.coffee +++ b/app/views/editor/level/edit.coffee @@ -29,6 +29,7 @@ module.exports = class EditorLevelView extends View 'click #fork-level-start-button': 'startForkingLevel' 'click #level-history-button': 'showVersionHistory' 'click #patches-tab': -> @patchesView.load() + 'click #components-tab': -> @componentsTab.refreshLevelThangsTreema @level.get('thangs') 'click #level-patch-button': 'startPatchingLevel' 'click #level-watch-button': 'toggleWatchLevel' 'click #pop-level-i18n-button': -> @level.populateI18N()