Fix #6464 - card header
[roojs1] / Roo / bootstrap / Popover.js
index e94a28d..da35540 100644 (file)
@@ -76,11 +76,11 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
                     cn : [
                         {
                             tag: 'h3',
-                            cls: 'popover-title',
+                            cls: 'popover-title popover-header',
                             html : this.title
                         },
                         {
-                            cls : 'popover-content',
+                            cls : 'popover-content popover-body',
                             html : this.html
                         }
                     ]
@@ -155,24 +155,24 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
     timeout : null,
     hoverState : null,
     
-    toggle : function (on_el) {
-        this.hoverState == 'in' ? this.leave() : this.enter(on_el);
+    toggle : function () {
+        this.hoverState == 'in' ? this.leave() : this.enter();
     },
     
-    enter : function (on_el) {
+    enter : function () {
         
         clearTimeout(this.timeout);
     
         this.hoverState = 'in';
     
         if (!this.delay || !this.delay.show) {
-            this.show(on_el);
+            this.show();
             return;
         }
         var _t = this;
         this.timeout = setTimeout(function () {
             if (_t.hoverState == 'in') {
-                _t.show(on_el);
+                _t.show();
             }
         }, this.delay.show)
     },
@@ -199,12 +199,16 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
         if (!on_el) {
             on_el= (this.over == 'parent') ? this.parent().el : Roo.get(this.over);
         }
+        
         // set content.
         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.html;
         }
-        this.el.removeClass(['fade','top','bottom', 'left', 'right','in']);
+        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();
         }
@@ -234,6 +238,8 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
             // fixme..
         }
         var align = Roo.bootstrap.Popover.alignment[placement];
+        
+//        Roo.log(align);
         this.el.alignTo(on_el, align[0],align[1]);
         //var arrow = this.el.select('.arrow',true).first();
         //arrow.set(align[2], 
@@ -245,6 +251,8 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
             // fade it?
         }
         
+        this.hoverState = 'in';
+        
         this.fireEvent('show', this);
         
     },
@@ -261,10 +269,10 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
 });
 
 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']
+    'left' : ['r-l', [-10,0], 'right bs-popover-right'],
+    'right' : ['l-r', [10,0], 'left bs-popover-left'],
+    'bottom' : ['t-b', [0,10], 'top bs-popover-top'],
+    'top' : [ 'b-t', [0,-10], 'bottom bs-popover-bottom']
 };
 
  
\ No newline at end of file