Roo/form/ComboBoxArray.js
[roojs1] / roojs-bootstrap-debug.js
index f43614a..d0ee463 100644 (file)
@@ -101,6 +101,7 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
          
         
         var cfg = Roo.apply({},  this.getAutoCreate());
+        
         cfg.id = this.id || Roo.id();
         
         // fill in the extra attributes 
@@ -923,7 +924,7 @@ Roo.extend(Roo.bootstrap.Column, Roo.bootstrap.Component,  {
             if (settings[size] === false) {
                 return;
             }
-            Roo.log(settings[size]);
+            
             if (!settings[size]) { // 0 = hidden
                 cfg.cls += ' hidden-' + size;
                 return;
@@ -1983,9 +1984,6 @@ Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component,  {
         
         this.triggerEl.addClass('dropdown-toggle');
         
-        
-        
-        
         if (Roo.isTouch) {
             this.el.on('touchstart'  , this.onTouch, this);
         }
@@ -1994,9 +1992,10 @@ Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component,  {
         this.el.on("mouseover", this.onMouseOver, this);
         this.el.on("mouseout", this.onMouseOut, this);
         
-        
     },
-    findTargetItem : function(e){
+    
+    findTargetItem : function(e)
+    {
         var t = e.getTarget(".dropdown-menu-item", this.el,  true);
         if(!t){
             return false;
@@ -2012,12 +2011,14 @@ Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component,  {
         return false;
     },
     
-    onTouch : function(e) {
-        e.stopEvent();
+    onTouch : function(e) 
+    {
+        //e.stopEvent(); this make the user popdown broken
         this.onClick(e);
     },
     
-    onClick : function(e){
+    onClick : function(e)
+    {
         Roo.log("menu.onClick");
         var t = this.findTargetItem(e);
         if(!t || t.isContainer){
@@ -2436,8 +2437,6 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
         //var type = this.el.dom.type;
         
         
-        
-        
         if(this.tabIndex !== undefined){
             this.el.dom.setAttribute('tabIndex', this.tabIndex);
         }
@@ -2598,12 +2597,11 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
         
         this.el.setStyle('display', 'block');
         
-        if(this.animate){
+        if(this.animate){  // element has 'fade'  - so stuff happens after .3s ?- not sure why the delay?
             var _this = this;
             (function(){
-                _this.el.addClass('in');
-                
-            }).defer(50);
+                this.el.addClass('in');
+            }).defer(50, this);
         }else{
             this.el.addClass('in');
             
@@ -2620,7 +2618,7 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
         this.el.setStyle('zIndex', '10001');
        
         this.fireEvent('show', this);
-        this.el.setStyle.defer(500, this.el, ['position', 'fixed'] ); // try and fix top jump?
+         
         
         
     },
@@ -2629,8 +2627,9 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
         this.maskEl.hide();
         Roo.get(document.body).removeClass("x-body-masked");
         this.el.removeClass('in');
+        this.el.select('.modal-dialog', true).first().setStyle('transform','');
         
-        if(this.animate){
+        if(this.animate){ // why
             var _this = this;
             (function(){ _this.el.setStyle('display', 'none'); }).defer(150);
         }else{
@@ -5291,7 +5290,7 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
     /**
      * Returns true if the cell is editable.
      * @param {Number} colIndex The column index
-     * @param {Number} rowIndex The row index
+     * @param {Number} rowIndex The row index - this is nto actually used..?
      * @return {Boolean}
      */
     isCellEditable : function(colIndex, rowIndex){
@@ -6017,11 +6016,11 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
                 }
                 
                 if (!config[size]) { // 0 = hidden
-                    cfg.cls += ' hidden-' + size;
+                    c.cls += ' hidden-' + size;
                     return;
                 }
                 
-                cfg.cls += ' col-' + size + '-' + config[size];
+                c.cls += ' col-' + size + '-' + config[size];
 
             });
             
@@ -6075,7 +6074,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
     
     onLoad : function()
     {
-        Roo.log('ds onload');
+//        Roo.log('ds onload');
         this.clear();
         
         var _this = this;
@@ -7577,7 +7576,7 @@ Roo.form.VTypes = function(){
     // closure these in so they are only created once.
     var alpha = /^[a-zA-Z_]+$/;
     var alphanum = /^[a-zA-Z0-9_]+$/;
-    var email = /^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/;
+    var email = /^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,24}$/;
     var url = /(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
 
     // All these messages and functions are configurable
@@ -7978,7 +7977,7 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
             }
             if (this.before && typeof(this.before) == 'object') {
                 this.before = Roo.factory(this.before);
-                Roo.log(this.before);
+                
                 inputblock.cn.push({
                     tag :'span',
                     cls : 'roo-input-before input-group-' +
@@ -7997,7 +7996,7 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
             }
             if (this.after && typeof(this.after) == 'object') {
                 this.after = Roo.factory(this.after);
-                Roo.log(this.after);
+                
                 inputblock.cn.push({
                     tag :'span',
                     cls : 'roo-input-after input-group-' +
@@ -8012,7 +8011,7 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
         };
         
         if (align ==='left' && this.fieldLabel.length) {
-                Roo.log("left and has label");
+                
                 cfg.cn = [
                     
                     {
@@ -8031,7 +8030,7 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
                     
                 ];
         } else if ( this.fieldLabel.length) {
-                Roo.log(" label");
+                
                  cfg.cn = [
                    
                     {
@@ -8047,7 +8046,6 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
 
         } else {
             
-                Roo.log(" no label && no align");
                 cfg.cn = [
                     
                         inputblock
@@ -8056,11 +8054,9 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
                 
                 
         };
-        Roo.log('input-parentType: ' + this.parentType);
         
         if (this.parentType === 'Navbar' &&  this.parent().bar) {
            cfg.cls += ' navbar-form';
-           Roo.log(cfg);
         }
         
         return cfg;
@@ -8667,7 +8663,7 @@ Roo.extend(Roo.bootstrap.TextArea, Roo.bootstrap.Input,  {
         }
         
         if (align ==='left' && this.fieldLabel.length) {
-                Roo.log("left and has label");
+//                Roo.log("left and has label");
                 cfg.cn = [
                     
                     {
@@ -8686,7 +8682,7 @@ Roo.extend(Roo.bootstrap.TextArea, Roo.bootstrap.Input,  {
                     
                 ];
         } else if ( this.fieldLabel.length) {
-                Roo.log(" label");
+//                Roo.log(" label");
                  cfg.cn = [
                    
                     {
@@ -8702,7 +8698,7 @@ Roo.extend(Roo.bootstrap.TextArea, Roo.bootstrap.Input,  {
 
         } else {
             
-                   Roo.log(" no label && no align");
+//                   Roo.log(" no label && no align");
                 cfg.cn = [
                     
                         inputblock
@@ -9053,8 +9049,6 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
         };
         
         if(this.multiple){
-            Roo.log('multiple');
-            
             box = {
                 tag: 'div',
                 cn: [
@@ -9133,7 +9127,7 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
         
         if (align ==='left' && this.fieldLabel.length) {
             
-                Roo.log("left and has label");
+//                Roo.log("left and has label");
                 cfg.cn = [
                     
                     {
@@ -9152,7 +9146,7 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
                     
                 ];
         } else if ( this.fieldLabel.length) {
-                Roo.log(" label");
+//                Roo.log(" label");
                  cfg.cn = [
                    
                     {
@@ -9168,7 +9162,7 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
 
         } else {
             
-                Roo.log(" no label && no align");
+//                Roo.log(" no label && no align");
                 cfg = combobox
                      
                 
@@ -9180,7 +9174,7 @@ Roo.extend(Roo.bootstrap.TriggerField, Roo.bootstrap.Input,  {
                 cfg.cls += ' col-' + size + '-' + settings[size];
             }
         });
-        Roo.log(cfg);
+        
         return cfg;
         
     },
@@ -11882,7 +11876,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         
         if (align ==='left' && this.fieldLabel.length) {
             
-                Roo.log("left and has label");
+//                Roo.log("left and has label");
                 cfg.cn = [
                     
                     {
@@ -11901,7 +11895,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
                     
                 ];
         } else if ( this.fieldLabel.length) {
-                Roo.log(" label");
+//                Roo.log(" label");
                  cfg.cn = [
                    
                     {
@@ -11917,7 +11911,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
 
         } else {
             
-                Roo.log(" no label && no align");
+//                Roo.log(" no label && no align");
                 cfg = combobox
                      
                 
@@ -13581,7 +13575,10 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
             this.el.dom.scrollTop = 0;
         }, this);
         
+        this.originalValue = this.getValue();
+        
         this.inputEl().on("click", this.showTouchView, this);
+        
         this.touchViewFooterEl.select('.roo-touch-view-cancel', true).first().on('click', this.hideTouchView, this);
         this.touchViewFooterEl.select('.roo-touch-view-ok', true).first().on('click', this.setTouchViewValue, this);
         
@@ -13615,6 +13612,12 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
                 close.on('click', this.removeBtnClick, this, close);
             }
         }
+        /*
+         * fix the bug in Safari iOS8
+         */
+        this.inputEl().on("focus", function(e){
+            document.activeElement.blur();
+        }, this);
         
         return;
         
@@ -13643,6 +13646,10 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
     
     showTouchView : function()
     {
+        if(this.disabled){
+            return;
+        }
+        
         this.touchViewHeaderEl.hide();
 
         if(this.fieldLabel.length){
@@ -13990,6 +13997,7 @@ Roo.apply(Roo.bootstrap.ComboBox,  {
             {
                 tag: 'div',
                 cls: 'modal-dialog',
+                style : 'position:fixed', // we have to fix position....
                 cn: [
                     {
                         tag: 'div',
@@ -15653,7 +15661,7 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
     },
     
     getAutoCreate : function(){
-         Roo.log('make popover?');
+         
         var cfg = {
            cls : 'popover roo-dynamic',
            style: 'display:block',
@@ -15707,7 +15715,7 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
             }
             //Roo.log("adding to ");
             this.el = Roo.get(document.body).createChild(cfg, position);
-            Roo.log(this.el);
+//            Roo.log(this.el);
         }
         this.initEvents();
     },
@@ -16049,8 +16057,6 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
         
         cfg.cls += ' tab-content';
         
-        Roo.log('get auto create...............');
-        
         if (this.carousel) {
             cfg.cls += ' carousel slide';
             
@@ -16088,12 +16094,6 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
     
     initEvents:  function()
     {
-        Roo.log('-------- init events on tab group ---------');
-        
-        
-        
-        Roo.log(this);
-        
         if(Roo.isTouch && this.slideOnTouch){
             this.el.on("touchstart", this.onTouchStart, this);
         }
@@ -16178,7 +16178,7 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
      */
     showPanel : function (pan)
     {
-        if(this.transition){
+        if(this.transition || typeof(pan) == 'undefined'){
             Roo.log("waiting for the transitionend");
             return;
         }
@@ -16186,13 +16186,21 @@ Roo.extend(Roo.bootstrap.TabGroup, Roo.bootstrap.Column,  {
         if (typeof(pan) == 'number') {
             pan = this.tabs[pan];
         }
+        
         if (typeof(pan) == 'string') {
             pan = this.getPanelByName(pan);
         }
+        
+        var cur = this.getActivePanel();
+        
+        if(!pan || !cur){
+            Roo.log('pan or acitve pan is undefined');
+            return false;
+        }
+        
         if (pan.tabId == this.getActivePanel().tabId) {
             return true;
         }
-        var cur = this.getActivePanel();
         
         if (false === cur.fireEvent('beforedeactivate')) {
             return false;
@@ -16430,15 +16438,13 @@ Roo.extend(Roo.bootstrap.TabPanel, Roo.bootstrap.Component,  {
     
     initEvents:  function()
     {
-        Roo.log('-------- init events on tab panel ---------');
-        
         var p = this.parent();
         this.navId = this.navId || p.navId;
         
         if (typeof(this.navId) != 'undefined') {
             // not really needed.. but just in case.. parent should be a NavGroup.
             var tg = Roo.bootstrap.TabGroup.get(this.navId);
-            Roo.log(['register', tg, this]);
+            
             tg.register(this);
             
             var i = tg.tabs.length - 1;
@@ -18597,7 +18603,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
         }
         
         if (align ==='left' && this.fieldLabel.length) {
-                Roo.log("left and has label");
+//                Roo.log("left and has label");
                 cfg.cn = [
                     
                     {
@@ -18616,7 +18622,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
                     
                 ];
         } else if ( this.fieldLabel.length) {
-                Roo.log(" label");
+//                Roo.log(" label");
                 cfg.cn = [
                    
                     {
@@ -18634,7 +18640,7 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input,  {
 
         } else {
             
-                Roo.log(" no label && no align");
+//                Roo.log(" no label && no align");
                 cfg.cn = [  inputblock ] ;
                 
                 
@@ -22222,7 +22228,6 @@ Roo.extend(Roo.bootstrap.PagingToolbar, Roo.bootstrap.NavSimplebar, {
         // add the buttons to the navgroup
         
         if(this.displayInfo){
-            Roo.log(this.el.select('ul.navbar-nav',true).first());
             this.el.select('ul.navbar-nav',true).first().createChild({cls:'x-paging-info'});
             this.displayEl = this.el.select('.x-paging-info', true).first();
 //            var navel = this.navgroup.addItem( { tagtype : 'span', html : '', cls : 'x-paging-info', preventDefault : true } );