gtkhotkey-0.2.1-patched.tgz
[gitlive] / XObject.js
index cee7002..1d9bcf0 100644 (file)
@@ -1,6 +1,6 @@
 //<script type="text/javascript">
-GIRepository = imports.gi.GIRepository;
-GObject = imports.gi.GObject;
+const GIRepository = imports.gi.GIRepository;
+const GObject = imports.gi.GObject;
 /**
  * XObject
  * Yet another attempt to create a usable object construction library for seed..
@@ -202,18 +202,20 @@ XObject.prototype = {
            
         }
         if (!this.el && xtypeof == 'object') {
+            XObject.log(this.xtype.toString());
             
             XObject.log("obj?"  + XObject.keys(this.config).join(','));
             try {
                                if (!isSeed) {
                                        // gjs does not like properties that do not exist..
                                        
-                                       
-                                       var li = this.config.listeners;
-                                       delete this.config['listeners'];
-                               }
+                                       this.el = new (this.xtype)({});
+                                       XObject.extend(this.el, this.config);
+                                
+                               } else {
                                
-                this.el = new (this.xtype)(this.config);
+                                       this.el = new (this.xtype)(this.config);
+                               }
             } catch(e) {
                 print(JSON.stringify(e,null,4));
                 print(JSON.stringify(this.config,null,4));
@@ -640,7 +642,11 @@ XObject.extend(XObject,
                     
             }
     },
-   
+       /**
+        * usefull for compatibilyt.
+        *
+        */
+    isSeed : typeof(Seed) != 'undefined',
     /**
      * Copies all the properties of config to obj, if the do not exist.
      * @param {Object} obj The receiver of the properties