roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Thu, 28 Jan 2021 08:13:08 +0000 (16:13 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 28 Jan 2021 08:13:08 +0000 (16:13 +0800)
roojs-bootstrap-debug.js

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

index 8b87525..64583a7 100644 (file)
@@ -19655,8 +19655,14 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
     
     getChildContainer : function()
     {
+        return this.contentEl;
         return this.el.select('.popover-content',true).first();
     },
+    getPopoverHeader : function()
+    {
+        return this.headerEl
+    }
+    
     
     getAutoCreate : function(){
          
@@ -19704,8 +19710,8 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
     setContent: function(str)
     {
         this.html = str;
-        if (this.el) {
-            this.el.select('.popover-content',true).first().dom.innerHTML = str;
+        if (this.contentEl) {
+            this.contentEl.dom.innerHTML = str;
         }
         
     },
@@ -19744,6 +19750,9 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
         Roo.EventManager.onWindowResize(this.resizeMask, this, true);
         
         
+        this.contentEl = this.el.select('.popover-content',true).first();
+        this.headerEl =  this.el.select('.popover-header',true).first();
+        
         this.initEvents();
     },
     
index 12701bc..cd8af67 100644 (file)
@@ -809,21 +809,21 @@ var C=this.calpopover.el.select('.popover-content',true).first();Roo.each(A,func
 var A=this;if(this.store.getCount()>0){this.store.data.each(function(d){A.addItem({id:d.data.id,start:(typeof(d.data.start_dt)==='string')?new Date.parseDate(d.data.start_dt,'Y-m-d H:i:s'):d.data.start_dt,end:(typeof(d.data.end_dt)==='string')?new Date.parseDate(d.data.end_dt,'Y-m-d H:i:s'):d.data.end_dt,time:d.data.start_time,title:d.data.title,description:d.data.description,venue:d.data.venue}
 );});}this.renderEvents();if(this.calevents.length&&this.loadMask){this.maskEl.hide();}},onBeforeLoad:function(){this.clearEvents();if(this.loadMask){this.maskEl.show();}}});
 // Roo/bootstrap/Popover.js
-Roo.bootstrap.Popover=function(A){Roo.bootstrap.Popover.superclass.constructor.call(this,A);this.addEvents({"show":true,"hide":true});};Roo.extend(Roo.bootstrap.Popover,Roo.bootstrap.Component,{title:false,html:false,placement:'right',trigger:'hover',modal:false,delay:0,over:false,can_build_overlaid:false,maskEl:false,getChildContainer:function(){return this.el.select('.popover-content',true).first();
-},getAutoCreate:function(){var A={cls:'popover roo-dynamic shadow roo-popover'+(this.modal?'-modal':''),style:'display:block',cn:[{cls:'arrow'},{cls:'popover-inner ',cn:[{tag:'h3',cls:'popover-title popover-header',html:this.title||''},{cls:'popover-content popover-body'+this.cls,html:this.html||''}
-]}]};return A;},setTitle:function(A){this.title=A;if(this.el){this.el.select('.popover-title',true).first().dom.innerHTML=A;}},setContent:function(A){this.html=A;if(this.el){this.el.select('.popover-content',true).first().dom.innerHTML=A;}},onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A);
-if(!this.el){var B=Roo.apply({},this.getAutoCreate());B.id=Roo.id();if(this.cls){B.cls+=' '+this.cls;}if(this.style){B.style=this.style;}this.el=Roo.get(document.body).createChild(B,A);}var C=[];if(typeof(this.items)!='undefined'){var D=this.items;delete this.items;
-for(var i=0;i<D.length;i++){C.push(this.addxtype(Roo.apply({},D[i])));}}this.items=C;this.maskEl=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);Roo.EventManager.onWindowResize(this.resizeMask,this,true);this.initEvents();},resizeMask:function(){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));
-},initEvents:function(){if(!this.modal){Roo.bootstrap.Popover.register(this);}this.el.select('.popover-title',true).setVisibilityMode(Roo.Element.DISPLAY);this.el.enableDisplayMode('block');this.el.hide();if(this.over===false&&!this.parent()){return;}if(this.triggers===false){return;
-}var A=(this.over=='parent'||this.over===false)?this.parent().el:Roo.get(this.over);var B=this.trigger?this.trigger.split(' '):[];Roo.each(B,function(C){if(C=='click'){A.on('click',this.toggle,this);}else if(C!='manual'){var D=C=='hover'?'mouseenter':'focusin';
-var E=C=='hover'?'mouseleave':'focusout';A.on(D,this.enter,this);A.on(E,this.leave,this);}},this);},timeout:null,hoverState:null,toggle:function(){this.hoverState=='in'?this.leave():this.enter();},enter:function(){clearTimeout(this.timeout);this.hoverState='in';
-if(!this.delay||!this.delay.show){this.show();return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='in'){_t.show();}},this.delay.show)},leave:function(){clearTimeout(this.timeout);this.hoverState='out';if(!this.delay||!this.delay.hide){this.hide();
-return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='out'){_t.hide();}},this.delay.hide)},show:function(A){A=A||false;if(!A){if(this.parent()&&(this.over=='parent'||(this.over===false))){A=this.parent().el;}else if(this.over){Roo.get(this.over);
-}}if(!this.el){this.render(document.body);}this.el.removeClass(['fade','top','bottom','left','right','in','bs-popover-top','bs-popover-bottom','bs-popover-left','bs-popover-right']);if(!this.title.length){this.el.select('.popover-title',true).hide();}var B=typeof this.placement=='function'?this.placement.call(this,this.el,A):this.placement;
-this.el.show();this.el.dom.style.display='block';var p=this.getPosition();var C=this.el.getBox();var D=Roo.bootstrap.Popover.alignment[B];this.el.addClass(D[2]);if(A){this.el.alignTo(A,D[0],D[1]);}else{var es=this.el.getSize();var x=Roo.lib.Dom.getViewWidth()/2;
-var y=Roo.lib.Dom.getViewHeight()/2;this.el.setXY([x-(es.width/2),y-(es.height/2)]);}this.el.addClass('in');if(this.el.hasClass('fade')){}this.hoverState='in';if(this.modal){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));
-this.maskEl.setStyle('z-index',Roo.bootstrap.Popover.zIndex++);this.maskEl.dom.style.display='block';this.maskEl.addClass('show');}this.el.setStyle('z-index',Roo.bootstrap.Popover.zIndex++);this.fireEvent('show',this);},hide:function(){this.el.setXY([0,0]);
-this.el.removeClass('in');this.el.hide();this.hoverState=null;this.maskEl.hide();this.fireEvent('hide',this);}});Roo.apply(Roo.bootstrap.Popover,{alignment:{'left':['r-l',[-10,0],'left bs-popover-left'],'right':['l-br',[10,0],'right bs-popover-right'],'bottom':['t-b',[0,10],'top bs-popover-top'],'top':['b-t',[0,-10],'bottom bs-popover-bottom']}
+Roo.bootstrap.Popover=function(A){Roo.bootstrap.Popover.superclass.constructor.call(this,A);this.addEvents({"show":true,"hide":true});};Roo.extend(Roo.bootstrap.Popover,Roo.bootstrap.Component,{title:false,html:false,placement:'right',trigger:'hover',modal:false,delay:0,over:false,can_build_overlaid:false,maskEl:false,getChildContainer:function(){return this.contentEl;
+return this.el.select('.popover-content',true).first();},getPopoverHeader:function(){return this.headerEl}getAutoCreate:function(){var cfg={cls:'popover roo-dynamic shadow roo-popover'+(this.modal?'-modal':''),style:'display:block',cn:[{cls:'arrow'},{cls:'popover-inner ',cn:[{tag:'h3',cls:'popover-title popover-header',html:this.title||''}
+,{cls:'popover-content popover-body'+this.cls,html:this.html||''}]}]};return cfg;},setTitle:function(A){this.title=A;if(this.el){this.el.select('.popover-title',true).first().dom.innerHTML=A;}},setContent:function(A){this.html=A;if(this.contentEl){this.contentEl.dom.innerHTML=A;
+}},onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A);if(!this.el){var B=Roo.apply({},this.getAutoCreate());B.id=Roo.id();if(this.cls){B.cls+=' '+this.cls;}if(this.style){B.style=this.style;}this.el=Roo.get(document.body).createChild(B,A);
+}var C=[];if(typeof(this.items)!='undefined'){var D=this.items;delete this.items;for(var i=0;i<D.length;i++){C.push(this.addxtype(Roo.apply({},D[i])));}}this.items=C;this.maskEl=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);Roo.EventManager.onWindowResize(this.resizeMask,this,true);
+this.contentEl=this.el.select('.popover-content',true).first();this.headerEl=this.el.select('.popover-header',true).first();this.initEvents();},resizeMask:function(){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));},initEvents:function(){if(!this.modal){Roo.bootstrap.Popover.register(this);
+}this.el.select('.popover-title',true).setVisibilityMode(Roo.Element.DISPLAY);this.el.enableDisplayMode('block');this.el.hide();if(this.over===false&&!this.parent()){return;}if(this.triggers===false){return;}var A=(this.over=='parent'||this.over===false)?this.parent().el:Roo.get(this.over);
+var B=this.trigger?this.trigger.split(' '):[];Roo.each(B,function(C){if(C=='click'){A.on('click',this.toggle,this);}else if(C!='manual'){var D=C=='hover'?'mouseenter':'focusin';var E=C=='hover'?'mouseleave':'focusout';A.on(D,this.enter,this);A.on(E,this.leave,this);
+}},this);},timeout:null,hoverState:null,toggle:function(){this.hoverState=='in'?this.leave():this.enter();},enter:function(){clearTimeout(this.timeout);this.hoverState='in';if(!this.delay||!this.delay.show){this.show();return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='in'){_t.show();
+}},this.delay.show)},leave:function(){clearTimeout(this.timeout);this.hoverState='out';if(!this.delay||!this.delay.hide){this.hide();return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='out'){_t.hide();}},this.delay.hide)},show:function(A){A=A||false;
+if(!A){if(this.parent()&&(this.over=='parent'||(this.over===false))){A=this.parent().el;}else if(this.over){Roo.get(this.over);}}if(!this.el){this.render(document.body);}this.el.removeClass(['fade','top','bottom','left','right','in','bs-popover-top','bs-popover-bottom','bs-popover-left','bs-popover-right']);
+if(!this.title.length){this.el.select('.popover-title',true).hide();}var B=typeof this.placement=='function'?this.placement.call(this,this.el,A):this.placement;this.el.show();this.el.dom.style.display='block';var p=this.getPosition();var C=this.el.getBox();
+var D=Roo.bootstrap.Popover.alignment[B];this.el.addClass(D[2]);if(A){this.el.alignTo(A,D[0],D[1]);}else{var es=this.el.getSize();var x=Roo.lib.Dom.getViewWidth()/2;var y=Roo.lib.Dom.getViewHeight()/2;this.el.setXY([x-(es.width/2),y-(es.height/2)]);}this.el.addClass('in');
+if(this.el.hasClass('fade')){}this.hoverState='in';if(this.modal){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.maskEl.setStyle('z-index',Roo.bootstrap.Popover.zIndex++);this.maskEl.dom.style.display='block';this.maskEl.addClass('show');
+}this.el.setStyle('z-index',Roo.bootstrap.Popover.zIndex++);this.fireEvent('show',this);},hide:function(){this.el.setXY([0,0]);this.el.removeClass('in');this.el.hide();this.hoverState=null;this.maskEl.hide();this.fireEvent('hide',this);}});Roo.apply(Roo.bootstrap.Popover,{alignment:{'left':['r-l',[-10,0],'left bs-popover-left'],'right':['l-br',[10,0],'right bs-popover-right'],'bottom':['t-b',[0,10],'top bs-popover-top'],'top':['b-t',[0,-10],'bottom bs-popover-bottom']}
 ,zIndex:20001,clickHander:false,onMouseDown:function(e){if(!e.getTarget(".roo-popover")){this.hideAll();}},popups:[],register:function(A){if(!Roo.bootstrap.Popover.clickHandler){Roo.bootstrap.Popover.clickHandler=Roo.get(document).on("mousedown",Roo.bootstrap.Popover.onMouseDown,Roo.bootstrap.Popover);
 }this.hideAll();this.popups.push(A);},hideAll:function(){this.popups.forEach(function(p){p.hide();});}});
 // Roo/bootstrap/Progress.js