Roo/bootstrap/Tooltip.js
authoredward <edward@roojs.com>
Wed, 2 Aug 2017 06:03:31 +0000 (14:03 +0800)
committeredward <edward@roojs.com>
Wed, 2 Aug 2017 06:03:31 +0000 (14:03 +0800)
Roo/bootstrap/Tooltip.js

index b1fabb0..20d7258 100644 (file)
@@ -249,23 +249,15 @@ Roo.extend(Roo.bootstrap.Tooltip, Roo.bootstrap.Component,  {
         
         Roo.log(xy);
         
-        if(xy[0] < 0){
-            placement = 'right';
-        }
-
-        if(xy[0] + this.el.getWidth() > Roo.lib.Dom.getViewWidth()){
-            placement = 'left';
+        if(placement == 'top' || placement == 'bottom'){
+            if(xy[0] < 0){
+                placement = 'right';
+            }
+            
+            if(xy[0] + this.el.getWidth() > Roo.lib.Dom.getViewWidth()){
+                placement = 'left';
+            }
         }
-                
-//        if(placement == 'top' || placement == 'bottom'){
-//            if(xy[0] < 0){
-//                placement = 'right';
-//            }
-//            
-//            if(xy[0] + this.el.getWidth() > Roo.lib.Dom.getViewWidth()){
-//                placement = 'left';
-//            }
-//        }
         
         align = Roo.bootstrap.Tooltip.alignment[placement];