Roo/bootstrap/Modal.js
[roojs1] / Roo / bootstrap / Modal.js
index 1d1d9a2..c1e7947 100644 (file)
@@ -299,7 +299,14 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
         if (this.editableTitle) {
             this.headerEditEl =  this.headerEl.select('.form-control',true).first();
             this.headerEl.on('click', function() { this.toggleHeaderInput(true) } , this);
-            this.headerEditEl .on('specialkey', function() { this.toggleHeaderInput(false) } , this);
+            this.headerEditEl.on('keyup', function(e) {
+                    if(e.isNavKeyPress()){
+                            this.toggleHeaderInput(false)
+                    }
+                }, this);
+            this.headerEditEl.on('blur', function(e) {
+                this.toggleHeaderInput(false)
+            });
         }
 
     },
@@ -507,6 +514,7 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
      */
     setTitle: function(str) {
         this.titleEl.dom.innerHTML = str;
+        this.title = str;
     },
     /**
      * Set the body of the Dialog
@@ -598,7 +606,9 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
     
             this.headerEditEl.dom.value = this.title;
             this.headerEditEl.removeClass('d-none');
+            this.headerEditEl.dom.focus();
             this.titleEl.addClass('d-none');
+            
             this.is_header_editing = true;
             return
         }