From d2a21381ffc862fa48feda059e262e41be832667 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 8 Feb 2021 10:55:29 +0800 Subject: [PATCH] roojs-bootstrap.js roojs-bootstrap-debug.js --- roojs-bootstrap-debug.js | 4 +++- roojs-bootstrap.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index abf8935003..6eb8003527 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -22252,7 +22252,9 @@ Roo.extend(Roo.bootstrap.TimeField, Roo.bootstrap.Input, { Roo.each(cls, function(c){ if(c == 'bottom'){ - _this.picker().setTop(_this.inputEl().getHeight()); + _this.picker().alignTo(_this.inputEl(), 't-b'); + + //_this.picker().setTop(_this.inputEl().getHeight()); return; } if(c == 'top'){ diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index ddadde1eba..bfbfcdc84e 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -929,7 +929,7 @@ e.preventDefault();},picker:function(){return this.pickerEl;},fillTime:function( ]}]},{tag:'td',cls:'separator'},{tag:'td',cn:[{tag:'a',href:'#',cls:'btn',cn:[{tag:'span',cls:'minutes-down fa fas fa-chevron-down'}]}]},{tag:'td',cls:'separator'}]});},update:function(){this.time=(typeof(this.time)==='undefined')?new Date():this.time;this.fill(); },fill:function(){var A=this.time.getHours();var B=this.time.getMinutes();var C='AM';if(A>11){C='PM';}if(A==0){A=12;}if(A>12){A=A-12;}if(A<10){A='0'+A;}if(B<10){B='0'+B;}this.pop.select('.timepicker-hour',true).first().dom.innerHTML=A;this.pop.select('.timepicker-minute',true).first().dom.innerHTML=B; this.pop.select('button',true).first().dom.innerHTML=C;},place:function(){this.picker().removeClass(['bottom-left','bottom-right','top-left','top-right']);var A=['bottom'];if((Roo.lib.Dom.getViewHeight()+Roo.get(document.body).getScroll().top)-(this.inputEl().getBottom()+this.picker().getHeight())<0){A.pop(); -A.push('top');}A.push('right');if((Roo.lib.Dom.getViewWidth()+Roo.get(document.body).getScroll().left)-(this.inputEl().getLeft()+this.picker().getWidth())<0){A.pop();A.push('left');}this.picker().addClass(A.join('-'));var B=this;Roo.each(A,function(c){if(c=='bottom'){B.picker().setTop(B.inputEl().getHeight()); +A.push('top');}A.push('right');if((Roo.lib.Dom.getViewWidth()+Roo.get(document.body).getScroll().left)-(this.inputEl().getLeft()+this.picker().getWidth())<0){A.pop();A.push('left');}this.picker().addClass(A.join('-'));var B=this;Roo.each(A,function(c){if(c=='bottom'){B.picker().alignTo(B.inputEl(),'t-b'); return;}if(c=='top'){B.picker().setTop(0-B.picker().getHeight());return;}if(c=='left'){B.picker().setLeft(B.inputEl().getLeft()+B.inputEl().getWidth()-B.el.getLeft()-B.picker().getWidth());return;}if(c=='right'){B.picker().setLeft(B.inputEl().getLeft()-B.el.getLeft()); return;}});},onFocus:function(){Roo.bootstrap.TimeField.superclass.onFocus.call(this);this.show();},onBlur:function(){Roo.bootstrap.TimeField.superclass.onBlur.call(this);this.hide();},show:function(){this.picker().show();this.pop.show();this.update();this.place(); this.fireEvent('show',this,this.date);},hide:function(){this.picker().hide();this.pop.hide();this.fireEvent('hide',this,this.date);},setTime:function(){this.hide();this.setValue(this.time.format(this.format));this.fireEvent('select',this,this.date);},onMousedown:function(e){e.stopPropagation(); -- 2.39.2