diff --git a/js/Events.js b/js/Events.js index 7afb8486..add57b82 100644 --- a/js/Events.js +++ b/js/Events.js @@ -29,6 +29,8 @@ Events = { GRID_DISPLAY_STATE_CHANGED: "GRID_DISPLAY_STATE_CHANGED", + FRAMESHEET_RELOADED: "FRAMESHEET_RELOADED", + /** * The framesheet was reseted and is now probably drastically different. * Number of frames, content of frames, color used for the palette may have changed. diff --git a/js/controller/PaletteController.js b/js/controller/PaletteController.js index 816f25d5..13302b02 100644 --- a/js/controller/PaletteController.js +++ b/js/controller/PaletteController.js @@ -88,7 +88,7 @@ // Initialize palette: this.createPalette_(this.framesheet.getUsedColors()); - $.subscribe(Events.FRAMESHEET_RESET, $.proxy(function(evt) { + $.subscribe(Events.FRAMESHEET_RELOADED, $.proxy(function(evt) { this.createPalette_(this.framesheet.getUsedColors()); }, this)); diff --git a/js/model/FrameSheet.js b/js/model/FrameSheet.js index 721c63b0..691870a1 100644 --- a/js/model/FrameSheet.js +++ b/js/model/FrameSheet.js @@ -68,6 +68,7 @@ var frameCfg = frameConfigurations[i]; this.addFrame(new ns.Frame(frameCfg)); } + $.publish(Events.FRAMESHEET_RELOADED); $.publish(Events.FRAMESHEET_RESET); } catch (e) { throw "Could not load serialized framesheet : " + e.message