From 60a6915a0b24975e28a02b28e43d34f6dbb15625 Mon Sep 17 00:00:00 2001 From: Ben Beltran Date: Tue, 12 Aug 2014 19:25:52 -0500 Subject: Components extend without having to define init --- dist/serpentity.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'dist/serpentity.js') 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]; + } + } + } + } }); /* -- cgit