diff --git a/app/views/editor/achievement/AchievementEditView.coffee b/app/views/editor/achievement/AchievementEditView.coffee index 524c14e2e..0825c9de6 100644 --- a/app/views/editor/achievement/AchievementEditView.coffee +++ b/app/views/editor/achievement/AchievementEditView.coffee @@ -41,6 +41,7 @@ module.exports = class AchievementEditView extends RootView change: @pushChangesToPreview @treema = @$el.find('#achievement-treema').treema(options) @treema.build() + @pushChangesToPreview() getRenderData: (context={}) -> context = super(context) @@ -54,6 +55,7 @@ module.exports = class AchievementEditView extends RootView @pushChangesToPreview() pushChangesToPreview: => + return unless @treema @$el.find('#achievement-view').empty() for key, value of @treema.data @achievement.set key, value diff --git a/app/views/editor/thang/ThangTypeColorsTabView.coffee b/app/views/editor/thang/ThangTypeColorsTabView.coffee index cdc624587..8f5884eda 100644 --- a/app/views/editor/thang/ThangTypeColorsTabView.coffee +++ b/app/views/editor/thang/ThangTypeColorsTabView.coffee @@ -14,7 +14,7 @@ module.exports = class ThangTypeColorsTabView extends CocoView super options @supermodel.loadModel @thangType, 'thang' @colorConfig = {hue: 0, saturation: 0.5, lightness: 0.5} - @spriteBuilder = new SpriteBuilder(@thangType) + @spriteBuilder = new SpriteBuilder(@thangType) if @thangType.get('raw') f = => @offset++ @updateMovieClip() @@ -54,7 +54,7 @@ module.exports = class ThangTypeColorsTabView extends CocoView @updateMovieClip() updateMovieClip: -> - return unless @currentColorGroupTreema + return unless @currentColorGroupTreema and @thangType.get('raw') actionDict = @thangType.getActions() animations = (a.animation for key, a of actionDict when a.animation) index = @offset % animations.length @@ -74,6 +74,7 @@ module.exports = class ThangTypeColorsTabView extends CocoView @stage.addChild @movieClip updateContainer: -> + return unless @thangType.get('raw') actionDict = @thangType.getActions() idle = actionDict.idle @stage.removeChild(@container) if @container