Roo/bootstrap/TimeField.js
authorEdward <edward@roojs.com>
Mon, 13 Oct 2014 06:55:36 +0000 (14:55 +0800)
committerEdward <edward@roojs.com>
Mon, 13 Oct 2014 06:55:36 +0000 (14:55 +0800)
Roo/bootstrap/TimeField.js

index 328866d..024fa87 100644 (file)
@@ -313,10 +313,23 @@ Roo.extend(Roo.bootstrap.TimeField, Roo.bootstrap.Input,  {
     {   
         this.picker().removeClass(['bottom', 'top', 'left', 'right']);
         Roo.log('run!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1');
-        Roo.log(Roo.lib.Dom.getViewHeight());
+        Roo.log(Roo.lib.Dom.getViewWidth());
         Roo.log(Roo.get(document.body).getScroll());
-        Roo.log(this.inputEl().getBottom());
-        Roo.log(this.picker().getHeight());
+        Roo.log(this.inputEl().getLeft());
+        Roo.log(this.picker().getWdith());
+        
+        if((Roo.lib.Dom.getViewHeight() + Roo.get(document.body).getScroll().top) - (this.inputEl().getBottom() + this.picker().getHeight()) < 0){
+            /*
+             * place to the top of element!
+             *
+             */
+            
+            this.picker().addClass('top');
+            this.picker().setTop(0 - this.picker().getHeight()).setLeft(this.inputEl().getLeft() - this.el.getLeft());
+            
+            return;
+        }
+        
         if((Roo.lib.Dom.getViewHeight() + Roo.get(document.body).getScroll().top) - (this.inputEl().getBottom() + this.picker().getHeight()) < 0){
             /*
              * place to the top of element!