diff options
| author | Ben Beltran <ben@nsovocal.com> | 2014-08-12 19:25:52 -0500 |
|---|---|---|
| committer | Ben Beltran <ben@nsovocal.com> | 2014-08-12 19:25:52 -0500 |
| commit | 60a6915a0b24975e28a02b28e43d34f6dbb15625 (patch) | |
| tree | ccf114757150425e9ab3e4587f09cd1795567d27 /dist/serpentity.js | |
| parent | a2949b6a6621627d0382fd1702d067b7b82322ed (diff) | |
Components extend without having to define initv0.1.6
Diffstat (limited to 'dist/serpentity.js')
| -rw-r--r-- | dist/serpentity.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dist/serpentity.js b/dist/serpentity.js index 2f91c25..3522b06 100644 --- a/dist/serpentity.js +++ b/dist/serpentity.js @@ -472,7 +472,19 @@ Class(Serpentity, "NodeCollection")({ * components can be any class whatsoever. */ Class(Serpentity, "Component")({ + prototype : { + init : function init(config) { + var property; + config = config || {}; + + for (property in config) { + if (config.hasOwnProperty(property)) { + this[property] = config[property]; + } + } + } + } }); /* |