From 08571fd399544503f4d65607a7056b709d08f67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 20 Jun 2011 00:03:15 +0100 Subject: [PATCH] Add comments. --- src/color/Color.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/color/Color.js b/src/color/Color.js index 10a3547d..15bfa86f 100644 --- a/src/color/Color.js +++ b/src/color/Color.js @@ -306,18 +306,29 @@ var Color = this.Color = Base.extend(new function() { }, { /** @lends Color# */ + /** + * Called by various setters whenever a color value changes + */ _changed: function() { this._cssString = null; for (var i = 0, l = this._owners && this._owners.length; i < l; i++) this._owners[i]._changed(Change.STYLE); }, + /** + * Called by PathStyle whenever this color is used to define an item's style + * This is required to pass on _changed() notifications to the _owners. + */ _addOwner: function(item) { if (!this._owners) this._owners = []; this._owners.push(item); }, + /** + * Called by PathStyle whenever this color stops being used to define an + * item's style. + */ _removeOwner: function(item) { var index = this._owners ? this._owners.indexOf(item) : -1; if (index != -1) {