Builder/LeftPanel.js
authorAlan Knowles <alan@akbkhome.com>
Tue, 4 May 2010 08:32:15 +0000 (16:32 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 4 May 2010 08:32:15 +0000 (16:32 +0800)
Builder/LeftPanel.js

index 991ffb4..e994fda 100755 (executable)
@@ -135,18 +135,24 @@ LeftPanel = new XObject({
                             
                         },
                         
-                        add : function(key, type, skel) {
+                        
+                        
+                        add : function(key, type,   val) {
                             
                             var data = this.toJS();
-                            if (typeof(data[key]) != 'undefined') {
+                            if ((typeof(data[key]) != 'undefined') && 
+                                (typeof(val) == 'undefined') ) {
                                 return;
                             }
-                            val = '';
-                            if (type == 'Boolean') {
-                                val = true;
-                            }
-                            if (type == 'Number') {
-                                val = 0;
+                            if (typeof(val) == 'undefined') {
+                                    
+                                val = '';
+                                if (type == 'Boolean') {
+                                    val = true;
+                                }
+                                if (type == 'Number') {
+                                    val = 0;
+                                }
                             }
                             data[key] = val;