Roo/bootstrap/Popover.js
authorAlan Knowles <alan@roojs.com>
Mon, 31 Aug 2015 07:51:06 +0000 (15:51 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 31 Aug 2015 07:51:06 +0000 (15:51 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/Popover.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 90860e7..5d98bc6 100644 (file)
@@ -120,8 +120,8 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
             if (trigger == 'click') {
                 on_el.on('click', this.toggle, this);
             } else if (trigger != 'manual') {
-                var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin'
-                var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
+                var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin';
+                var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout';
       
                 on_el.on(eventIn  ,this.enter, this);
                 on_el.on(eventOut, this.leave, this);
index 59e5f32..616a9b5 100644 (file)
@@ -13967,8 +13967,8 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
             if (trigger == 'click') {
                 on_el.on('click', this.toggle, this);
             } else if (trigger != 'manual') {
-                var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin'
-                var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
+                var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin';
+                var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout';
       
                 on_el.on(eventIn  ,this.enter, this);
                 on_el.on(eventOut, this.leave, this);
index c9fa8f9..385ea20 100644 (file)
@@ -309,7 +309,7 @@ this.renderEvents();if(this.calevents.length&&this.loadMask){this.maskEl.hide();
 Roo.bootstrap.Popover=function(A){Roo.bootstrap.Popover.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Popover,Roo.bootstrap.Component,{title:'Fill in a title',html:false,placement:'right',trigger:'hover',delay:0,over:'parent',can_build_overlaid:false,getChildContainer:function(){return this.el.select('.popover-content',true).first();},getAutoCreate:function(){Roo.log('make popover?');var A={cls:'popover roo-dynamic',style:'display:block',cn:[{cls:'arrow'},{cls:'popover-inner',cn:[{tag:'h3',cls:'popover-title',html:this.title},{cls:'popover-content',html:this.html}]}]};return A;},setTitle:function(A){this.el.select('.popover-title',true).first().dom.innerHTML=A;},setContent:function(A){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;}
 Roo.log("adding to ")
 this.el=Roo.get(document.body).createChild(B,A);Roo.log(this.el);}
-this.initEvents();},initEvents:function(){this.el.select('.popover-title',true).setVisibilityMode(Roo.Element.DISPLAY);this.el.enableDisplayMode('block');this.el.hide();if(this.over===false){return;}if(this.triggers===false){return;}var A=(this.over=='parent')?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 eventOut=C=='hover'?'mouseleave':'focusout'A.on(D,this.enter,this);A.on(eventOut,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){if(!A){A=(this.over=='parent')?this.parent().el:Roo.get(this.over);}
+this.initEvents();},initEvents:function(){this.el.select('.popover-title',true).setVisibilityMode(Roo.Element.DISPLAY);this.el.enableDisplayMode('block');this.el.hide();if(this.over===false){return;}if(this.triggers===false){return;}var A=(this.over=='parent')?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){if(!A){A=(this.over=='parent')?this.parent().el:Roo.get(this.over);}
 this.el.select('.popover-title',true).first().dom.innerHtml=this.title;if(this.html!==false){this.el.select('.popover-content',true).first().dom.innerHtml=this.title;}
 this.el.removeClass(['fade','top','bottom','left','right','in']);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;var C=/\s?auto?\s?/i;var D=C.test(B);if(D){B=B.replace(C,'')||'top';}
 this.el.show();this.el.dom.style.display='block';this.el.addClass(B);var p=this.getPosition();var E=this.el.getBox();if(D){}var F=Roo.bootstrap.Popover.alignment[B];this.el.alignTo(A,F[0],F[1]);this.el.addClass('in');this.hoverState=null;if(this.el.hasClass('fade')){}},hide:function(){this.el.setXY([0,0]);this.el.removeClass('in');this.el.hide();}});Roo.bootstrap.Popover.alignment={'left':['r-l',[-10,0],'right'],'right':['l-r',[10,0],'left'],'bottom':['t-b',[0,10],'top'],'top':['b-t',[0,-10],'bottom']};