]> git.r.bdr.sh - rbdr/serpentity/blobdiff - dist/serpentity.js
Components extend without having to define init
[rbdr/serpentity] / dist / serpentity.js
index 2f91c253fa0f0bf69901b35c84762a8c7f99f40d..3522b063a3a715436c6fe5131e2dd8bfb6c53556 100644 (file)
@@ -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];
+                }
+            }
+        }
+    }
 });
 
 /*