Sample/Editor.bjs
[app.Builder.js] / Sample / Window.js
index ceacced..172a887 100644 (file)
@@ -1972,6 +1972,14 @@ Window=new XObject({
                                                                         
                                                                      //   this.activePath = false;
                                                                        // stop editing!!!!
+                                                                        if (this.get('/Editor').dirty) {
+                                                                            if (!this.get('/Editor.buffer').checkSyntax()) {
+                                                                               this.get('/StandardErrorDialog').show("Fix errors in code and save.."); 
+                                                                               return true;
+                                                                                // error Dialog
+                                                                            }
+                                                                            this.get('/Editor.view').save();
+                                                                        }   
                                                                         this.get('/LeftPanel').editableColumn.items[0].el.stop_editing();
                                                                         this.get('/LeftPanel').editing = false;
                                                                     
@@ -2241,7 +2249,8 @@ Window=new XObject({
                                                                         return ret;
                                                                     },
                                                                     startEditing : function(path,col) {
-                                                                    // alled by menu 'edit' currently..
+                                                                        
+                                                                        // alled by menu 'edit' currently..
                                                                         /**
                                                                         * start editing path (or selected if not set..)
                                                                         * @param {String|false} path  (optional) treepath to edit - selected tree gets
@@ -2462,9 +2471,9 @@ Window=new XObject({
                                                                                    
                                                                                 }
                                                                             },
+                                                                            editable : false,
                                                                             pack : "pack_start",
                                                                             text_column : 0,
-                                                                            editable : true,
                                                                             has_entry : true,
                                                                             init : function() {
                                                                                 XObject.prototype.init.call(this);