From 209e0781e926212bbaaad9e8ca4b61a0c389b30f Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 28 Feb 2012 17:19:42 -0800 Subject: We need to remove color buttons from the color model when updating the PI for selection change. Signed-off-by: Nivesh Rajbhandari --- js/components/ui/color-chip.reel/color-chip.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'js/components') diff --git a/js/components/ui/color-chip.reel/color-chip.js b/js/components/ui/color-chip.reel/color-chip.js index ed1ac27a..7a7411da 100755 --- a/js/components/ui/color-chip.reel/color-chip.js +++ b/js/components/ui/color-chip.reel/color-chip.js @@ -92,6 +92,21 @@ var ColorChip = exports.ColorChip = Montage.create(Component, { this.changeDelegate(evt); } } + }, + + destroy: { + value: function() { + this.application.ninja.colorController.removeButton(this.mode, this.chipBtn); + var mode = this.mode; + if(this.iconType) { + if(this.iconType === "fillIcon") { + mode = "fill"; + } else if(this.iconType === "strokeIcon") { + mode = "stroke"; + } + } + this.application.ninja.colorController.removeButton(mode, this.icon); + } } }); -- cgit v1.2.3