mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Use an injection loop to produce all methods that simply forward from Palette to root Component.
This commit is contained in:
parent
5456f1a595
commit
6e4c2ebc64
1 changed files with 11 additions and 20 deletions
|
@ -73,29 +73,13 @@
|
||||||
return this._values;
|
return this._values;
|
||||||
},
|
},
|
||||||
|
|
||||||
getTitle: function() {
|
|
||||||
return this._root.getTitle();
|
|
||||||
},
|
|
||||||
|
|
||||||
setTitle: function(title) {
|
|
||||||
return this._root.setTitle(title);
|
|
||||||
},
|
|
||||||
|
|
||||||
getEnabled: function() {
|
|
||||||
return this._root.getEnabled();
|
|
||||||
},
|
|
||||||
|
|
||||||
setEnabled: function(enabled) {
|
|
||||||
return this._root.setEnabled(enabled);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @name Palette#reset()
|
||||||
|
* @function
|
||||||
|
*
|
||||||
* Resets the values of the components to their
|
* Resets the values of the components to their
|
||||||
* {@link Component#defaultValue}.
|
* {@link Component#defaultValue}.
|
||||||
*/
|
*/
|
||||||
reset: function() {
|
|
||||||
this._root.reset();
|
|
||||||
},
|
|
||||||
|
|
||||||
remove: function() {
|
remove: function() {
|
||||||
DomElement.remove(this._element);
|
DomElement.remove(this._element);
|
||||||
|
@ -106,4 +90,11 @@
|
||||||
palettes.splice(index, 1);
|
palettes.splice(index, 1);
|
||||||
return remove;
|
return remove;
|
||||||
}
|
}
|
||||||
});
|
}, Base.each(['getTitle', 'setTitle', 'getEnabled', 'setEnabled', 'reset'],
|
||||||
|
function(name) {
|
||||||
|
this[name] = function() {
|
||||||
|
var root = this._root;
|
||||||
|
return root[name].apply(root, arguments);
|
||||||
|
}
|
||||||
|
}, {})
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in a new issue