XObject.js
authorAlan Knowles <alan@wideboy.(none)>
Thu, 15 Apr 2010 13:37:38 +0000 (21:37 +0800)
committerAlan Knowles <alan@wideboy.(none)>
Thu, 15 Apr 2010 13:37:38 +0000 (21:37 +0800)
XObject.js

index 2189cd7..b441603 100644 (file)
@@ -127,8 +127,11 @@ XObject.prototype = {
       * @arg cfg {Object} same as XObject constructor.
       */
     addItem : function(o) {
-        var item = new XObject(o);
-         item.parent = this;
+        
+        
+        
+        var item = o.constructor == XObject ? o : xnew XObject(o);
+        item.parent = this;
         this.items.push(item);
         
         if (item.pack===false) {  // no