Fix bug when values do not have associated components.

This commit is contained in:
Jürg Lehni 2012-11-14 18:30:22 -08:00
parent 5097bf37ff
commit bd8dc0c3de

View file

@ -45,17 +45,19 @@ var Palette = this.Palette = Base.extend(Callback, /** @lends Palette# */{
// directly link the value to the component and observe change.
this._values = Base.each(values, function(value, name) {
var component = components[name];
Base.define(values, name, {
enumerable: true,
configurable: true,
writable: true,
get: function() {
return component._value;
},
set: function(val) {
component.setValue(val);
}
});
if (component) {
Base.define(values, name, {
enumerable: true,
configurable: true,
writable: true,
get: function() {
return component._value;
},
set: function(val) {
component.setValue(val);
}
});
}
});
if (window.paper)
paper.palettes.push(this);