roojs-bootstrap.js
authorEdward <edward@roojs.com>
Thu, 25 Sep 2014 07:38:15 +0000 (15:38 +0800)
committerEdward <edward@roojs.com>
Thu, 25 Sep 2014 07:38:15 +0000 (15:38 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index 396ca46..be3b06c 100644 (file)
@@ -4046,11 +4046,11 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
             cn: [
                 {
                     tag: "div",
-                    style: "background-color:white;width:50%;margin:100 auto",
+                    style: "background-color:white;width:50%;margin:100 auto; display:none",
                     cn: [
                         {
                             tag: "img",
-                            src: rootURL + '/roojs1/images/ux/lightbox/loading.gif'
+                            src: Roo.rootURL + '/images/ux/lightbox/loading.gif'
                         },
                         {
                             tag: "span",
@@ -4061,7 +4061,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
                 }
             ]
         }
-        this.maskEl = Roo.DomHelper.append(this.parent().el, mark, true);
+        this.maskEl = Roo.DomHelper.append(document.body, mark, true);
         
         var size = this.parent().el.getSize();
         
@@ -11556,17 +11556,6 @@ Roo.extend(Roo.bootstrap.Calendar, Roo.bootstrap.Component,  {
         
         cells[0].events.push(ev);
         
-//        if((typeof(cells[0].events) == 'undefined')){
-//            cells[0].events = [];
-//        }
-//        
-//        cells[0].events.push(ev);
-//        ev.rendered = false;
-//        for (var i = 0; i < cells.length;i++) {
-//            cells[i].rows = Math.max(cells[i].rows || 0 , ev.row + 1 );
-//            
-//        }
-        
         this.calevents.push(ev);
     },
     
@@ -11597,87 +11586,7 @@ Roo.extend(Roo.bootstrap.Calendar, Roo.bootstrap.Component,  {
     },
     
     renderEvents: function()
-    {  
-//        for (var e = 0; e < this.calevents.length; e++) {
-//            
-//            var ev = this.calevents[e];
-//            var cells = ev.cells;
-//            var rows = ev.rows;
-//            
-//            for (var j = 0; j < cells.length; j++){
-//            
-//                if(!cells[j].more.length){
-//                    cells[j].row++;
-//                }
-//                if(cells[j].row > 3){
-//                    cells[j].more.push(ev);
-//                    continue;
-//                }
-//                
-//                cells[j].events.push(ev);
-//            }
-//        }
-            
-//            for (var i = 0; i < rows.length; i++){
-//                // how many rows should it span..
-//
-//                var  cfg = {
-//                    cls : 'roo-dynamic fc-event fc-event-hori fc-event-draggable ui-draggable',
-//                    style : 'position: absolute', // left: 387px; width: 121px; top: 359px;
-//
-//                    unselectable : "on",
-//                    cn : [
-//                        {
-//                            cls: 'fc-event-inner',
-//                            cn : [
-////                                {
-////                                  tag:'span',
-////                                  cls: 'fc-event-time',
-////                                  html : cells.length > 1 ? '' : ev.time
-////                                },
-//                                {
-//                                  tag:'span',
-//                                  cls: 'fc-event-title',
-//                                  html : String.format('{0}', ev.title)
-//                                }
-//
-//
-//                            ]
-//                        },
-//                        {
-//                            cls: 'ui-resizable-handle ui-resizable-e',
-//                            html : '&nbsp;&nbsp;&nbsp'
-//                        }
-//
-//                    ]
-//                };
-//
-//                if (i == 0) {
-//                    cfg.cls += ' fc-event-start';
-//                }
-//                if ((i+1) == rows.length) {
-//                    cfg.cls += ' fc-event-end';
-//                }
-//
-//                var ctr = this.el.select('.fc-event-container',true).first();
-//                var cg = ctr.createChild(cfg);
-//
-//                var sbox = rows[i].start.select('.fc-day-content',true).first().getBox();
-//                var ebox = rows[i].end.select('.fc-day-content',true).first().getBox();
-//
-//                cg.setXY([sbox.x +2, sbox.y +(e * 20)]);    
-//                cg.setWidth(ebox.right - sbox.x -2);
-//
-//                cg.on('mouseenter' ,this.onEventEnter, this, ev);
-//                cg.on('mouseleave' ,this.onEventLeave, this, ev);
-//                cg.on('click', this.onEventClick, this, ev);
-//
-//                ev.els.push(cg);
-//
-//                
-//            }
-//        }
-        
+    {   
         var _this = this;
         
         this.cells.each(function(c) {
@@ -11704,25 +11613,6 @@ Roo.extend(Roo.bootstrap.Calendar, Roo.bootstrap.Component,  {
             
         });
             
-//        for (var e = 0; e < this.calevents.length; e++) {
-//            
-//            var ev = this.calevents[e];
-//            var cells = ev.cells;
-//            var rows = ev.rows;
-//            
-//            for(var i = 0; i < cells.length; i++){
-//                
-//                var cbox = this.cells.item(this.cells.indexOf(cells[i]));
-//                
-//                if(cells.length < 2 && cbox.rows.length > 3){
-//                    cbox.more.push(ev);
-//                    continue;
-//                }
-//                
-//                cbox.rows.push(ev);
-//            }
-//        }
-//        
         this.cells.each(function(c) {
             
             c.select('.fc-day-content div',true).first().setHeight(Math.max(34, c.row * 20));
index 2fa02b1..5c7edbb 100644 (file)
@@ -99,8 +99,8 @@ this.fireEvent('click',this,e);}});
 Roo.bootstrap.Slider=function(A){Roo.bootstrap.Slider.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Slider,Roo.bootstrap.Component,{getAutoCreate:function(){var A={tag:'div',cls:'slider slider-sample1 vertical-handler ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all',cn:[{tag:'a',cls:'ui-slider-handle ui-state-default ui-corner-all'}]};return A;}});
 //Roo/bootstrap/Table.js
 Roo.bootstrap.Table=function(A){Roo.bootstrap.Table.superclass.constructor.call(this,A);if(this.sm){this.selModel=Roo.factory(this.sm,Roo.bootstrap.Table);this.sm=this.selModel;this.sm.xmodule=this.xmodule||false;}if(this.cm&&typeof(this.cm.config)=='undefined'){this.colModel=new Roo.grid.ColumnModel(this.cm);this.cm=this.colModel;this.cm.xmodule=this.xmodule||false;}if(this.store){this.store=Roo.factory(this.store,Roo.data);this.ds=this.store;this.ds.xmodule=this.xmodule||false;}if(this.footer&&this.store){this.footer.dataSource=this.ds;this.footer=Roo.factory(this.footer);}};Roo.extend(Roo.bootstrap.Table,Roo.bootstrap.Component,{cls:false,align:false,bgcolor:false,border:false,cellpadding:false,cellspacing:false,frame:false,rules:false,sortable:false,summary:false,width:false,striped:false,bordered:false,hover:false,condensed:false,responsive:false,sm:false,cm:false,store:false,loadMask:false,getAutoCreate:function(){var A=Roo.apply({},Roo.bootstrap.Table.superclass.getAutoCreate.call(this));A={tag:'table',cls:'table',cn:[]};if(this.striped){A.cls+=' table-striped';}if(this.hover){A.cls+=' table-hover';}if(this.bordered){A.cls+=' table-bordered';}if(this.condensed){A.cls+=' table-condensed';}if(this.responsive){A.cls+=' table-responsive';}if(this.cls){A.cls+=' '+this.cls;}if(this.align){A.align=this.align;}if(this.bgcolor){A.bgcolor=this.bgcolor;}if(this.border){A.border=this.border;}if(this.cellpadding){A.cellpadding=this.cellpadding;}if(this.cellspacing){A.cellspacing=this.cellspacing;}if(this.frame){A.frame=this.frame;}if(this.rules){A.rules=this.rules;}if(this.sortable){A.sortable=this.sortable;}if(this.summary){A.summary=this.summary;}if(this.width){A.width=this.width;}if(this.store||this.cm){A.cn.push(this.renderHeader());A.cn.push(this.renderBody());A.cn.push(this.renderFooter());A.cls+=' TableGrid';}return A;},initEvents:function(){if(!this.store||!this.cm){return;}
-Roo.log('initEvents with ds!!!!');var A=this;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',A.sort,A);});this.parent().el.setStyle('position','relative');if(this.footer){this.footer.parentId=this.id;this.footer.onRender(this.el.select('tfoot tr td').first(),null);}var B={tag:"div",cls:"x-dlg-mask",style:"text-align:center",cn:[{tag:"div",style:"background-color:white;width:50%;margin:100 auto",cn:[{tag:"img",src:rootURL+'/roojs1/images/ux/lightbox/loading.gif'},{tag:"span",html:"Loading"}]}]}
-this.maskEl=Roo.DomHelper.append(this.parent().el,B,true);var C=this.parent().el.getSize();this.maskEl.setSize(C.width,300);this.maskEl.enableDisplayMode("block");this.store.on('load',this.onLoad,this);this.store.on('beforeload',this.onBeforeLoad,this);},sort:function(e,el){var A=Roo.get(el)if(!A.hasClass('sortable')){return;}var sort=A.attr('sort');var B='ASC';if(A.hasClass('glyphicon-arrow-up')){B='DESC';}
+Roo.log('initEvents with ds!!!!');var A=this;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',A.sort,A);});this.parent().el.setStyle('position','relative');if(this.footer){this.footer.parentId=this.id;this.footer.onRender(this.el.select('tfoot tr td').first(),null);}var B={tag:"div",cls:"x-dlg-mask",style:"text-align:center",cn:[{tag:"div",style:"background-color:white;width:50%;margin:100 auto; display:none",cn:[{tag:"img",src:Roo.rootURL+'/images/ux/lightbox/loading.gif'},{tag:"span",html:"Loading"}]}]}
+this.maskEl=Roo.DomHelper.append(document.body,B,true);var C=this.parent().el.getSize();this.maskEl.setSize(C.width,300);this.maskEl.enableDisplayMode("block");this.store.on('load',this.onLoad,this);this.store.on('beforeload',this.onBeforeLoad,this);},sort:function(e,el){var A=Roo.get(el)if(!A.hasClass('sortable')){return;}var sort=A.attr('sort');var B='ASC';if(A.hasClass('glyphicon-arrow-up')){B='DESC';}
 this.store.sortInfo={field:sort,direction:B};this.store.load();},renderHeader:function(){var A={tag:'thead',cn:[]};var cm=this.cm;for(var i=0,B=cm.getColumnCount();i<B;i++){var C=cm.config[i];if(typeof(C.hidden)!='undefined'&&C.hidden){continue;}var c={tag:'th',html:cm.getColumnHeader(i)};if(typeof(C.dataIndex)!='undefined'){c.sort=C.dataIndex;}if(typeof(C.sortable)!='undefined'&&C.sortable){c.cls='sortable';}if(typeof(C.width)!='undefined'){c.style='width:'+C.width+'px';}
 A.cn.push(c)}return A;},renderBody:function(){var A={tag:'tbody',cn:[]};return A;},renderFooter:function(){var A={tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'td',colspan:1}]}]};return A;},onLoad:function(){Roo.log('ds onload');var A=this;var cm=this.cm;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.removeClass(['glyphicon','glyphicon-arrow-up','glyphicon-arrow-down']);if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='ASC'){e.addClass(['glyphicon','glyphicon-arrow-up']);}if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='DESC'){e.addClass(['glyphicon','glyphicon-arrow-down']);}});var B=this.el.select('tbody',true).first();var C=[];if(this.store.getCount()>0){this.store.data.each(function(d){var D={tag:'tr',cn:[]};for(var i=0,E=cm.getColumnCount();i<E;i++){var F=cm.config[i];if(typeof(F.hidden)!='undefined'&&F.hidden){continue;}var G=cm.getRenderer(i);var H='';var id=Roo.id();if(typeof(G)!=='undefined'){H=G(d.data[cm.getDataIndex(i)],false,d);}if(typeof(H)==='object'){C.push({id:id,cfg:H})}var td={tag:'td',id:id,html:(typeof(H)==='object')?'':H};if(typeof(F.width)!='undefined'){td.style='width:'+F.width+'px';}
 D.cn.push(td);}