mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Fix bug when values do not have associated components.
This commit is contained in:
parent
5097bf37ff
commit
bd8dc0c3de
1 changed files with 13 additions and 11 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue