Sample/DialogNewComponent.js
authorAlan Knowles <alan@akbkhome.com>
Thu, 27 May 2010 11:16:35 +0000 (19:16 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 27 May 2010 11:16:35 +0000 (19:16 +0800)
Sample/DialogNewComponent.js

index b821da0..f7af9ff 100644 (file)
@@ -31,7 +31,7 @@ DialogNewComponent=new XObject({
                 }
                 var isNew = this.file.name.length ? false : true;
                 
-                if (this.file.name.length && this.file.name != this.get('name').el.get_text().length ) {
+                if (this.file.name.length && this.file.name != this.get('name').el.get_text()) {
                     this.get('/StandardErrorDialog').show(
                         "Sorry changing names does not work yet. "
                     );
@@ -106,6 +106,11 @@ DialogNewComponent=new XObject({
             c[i] = c[i] || this.def[i];
             this.get(i).el.set_text(c[i]);
         }
+        if (c.name) {
+            this.el.set_title("Edit File Details - " + c.name);
+        } else {
+            this.el.set_title("Create New File");
+        }
          
         this.file = c;
         console.log('show all');