Switch to Edit Tab view when saving a new plant
authorJoachim Breitner <mail@joachim-breitner.de>
Fri, 26 Jun 2009 08:27:41 +0000 (10:27 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Fri, 26 Jun 2009 08:27:41 +0000 (10:27 +0200)
web/js/communication.js
web/php/page/createplant.pg

index 9d27db4..ee0db69 100644 (file)
@@ -380,7 +380,20 @@ Lseed.Communication = function() {
                        cmp.removeAll();
                        cmp.add(elem);
                } else {
-                       console.error("Lseed.Communication.clearNavigation: 'navTree' does not exist.");
+                       console.error("Lseed.Communication.closeAllTabs: 'contentTabPanel' does not exist.");
+               }
+       };
+       
+       this.closeTab = function(tabname) {
+               var cmp = Ext.getCmp('contentTabPanel');
+               if (cmp) {
+                       var tab = this.getTab(tabname);
+                       if (tab) {
+                               console.error("Lseed.Communication.closeTab: '"+tabname+"' does not exist.");
+                       }
+                       cmp.remove(tab);
+               } else {
+                       console.error("Lseed.Communication.closeTab: 'contentTabPanel' does not exist.");
                }
        };
        
index d347416..a0559a2 100644 (file)
@@ -24,6 +24,8 @@
                                        ,Code: planteditor.getValue()
                                });
                                editor.Save(plant);
+                               editor.Edit(plant);
+                               communication.closeTab("createplant");
                        } else {
                                communication.showMessage("Ihre Pflanze benötigt einen Namen.", "error");
                        }