From 440201bdbbfdafec5ecca2e437b15f950a5ddc5d Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 8 Feb 2021 11:05:37 +0800 Subject: [PATCH] sync --- Roo/bootstrap/TimeField.js | 15 ++- docs/src/Roo_bootstrap_TimeField.js.html | 112 +++++++++++------------ 2 files changed, 64 insertions(+), 63 deletions(-) diff --git a/Roo/bootstrap/TimeField.js b/Roo/bootstrap/TimeField.js index 0b13b5edfe..b258728282 100644 --- a/Roo/bootstrap/TimeField.js +++ b/Roo/bootstrap/TimeField.js @@ -334,23 +334,27 @@ Roo.extend(Roo.bootstrap.TimeField, Roo.bootstrap.Input, { cls.pop(); cls.push('left'); } - + //this.picker().setXY(20000,20000); this.picker().addClass(cls.join('-')); var _this = this; Roo.each(cls, function(c){ if(c == 'bottom'){ - _this.picker().alignTo(_this.inputEl(), 't-b'); - + (function() { + // + }).defer(200); + _this.picker().alignTo(_this.inputEl(), "tr-br", [0, 10], false); //_this.picker().setTop(_this.inputEl().getHeight()); return; } if(c == 'top'){ - _this.picker().setTop(0 - _this.picker().getHeight()); + _this.picker().alignTo(_this.inputEl(), "br-tr", [0, 10], false); + + //_this.picker().setTop(0 - _this.picker().getHeight()); return; } - + /* if(c == 'left'){ _this.picker().setLeft(_this.inputEl().getLeft() + _this.inputEl().getWidth() - _this.el.getLeft() - _this.picker().getWidth()); return; @@ -359,6 +363,7 @@ Roo.extend(Roo.bootstrap.TimeField, Roo.bootstrap.Input, { _this.picker().setLeft(_this.inputEl().getLeft() - _this.el.getLeft()); return; } + */ }); }, diff --git a/docs/src/Roo_bootstrap_TimeField.js.html b/docs/src/Roo_bootstrap_TimeField.js.html index 8cdb762f3f..a22129a525 100644 --- a/docs/src/Roo_bootstrap_TimeField.js.html +++ b/docs/src/Roo_bootstrap_TimeField.js.html @@ -55,7 +55,7 @@ getAutoCreate : function() { this.after = '<i class="fa far fa-clock"></i>'; - Roo.bootstrap.TimeField.superclass.getAutoCreate.call(this); + return Roo.bootstrap.TimeField.superclass.getAutoCreate.call(this); }, @@ -64,7 +64,7 @@ Roo.bootstrap.TimeField.superclass.onRender.call(this, ct, position); - this.el.select('>.input-group', true).first().createChild(Roo.bootstrap.TimeField.template); + this.pickerEl = Roo.get(document.body).createChild(Roo.bootstrap.TimeField.template); this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block'; @@ -79,10 +79,10 @@ this.fillTime(); this.update(); - this.pop.select('span.hours-up', true).first().on('click', this.onIncrementHours, this); - this.pop.select('span.hours-down', true).first().on('click', this.onDecrementHours, this); - this.pop.select('span.minutes-up', true).first().on('click', this.onIncrementMinutes, this); - this.pop.select('span.minutes-down', true).first().on('click', this.onDecrementMinutes, this); + this.pop.select('.hours-up', true).first().on('click', this.onIncrementHours, this); + this.pop.select('.hours-down', true).first().on('click', this.onDecrementHours, this); + this.pop.select('.minutes-up', true).first().on('click', this.onIncrementMinutes, this); + this.pop.select('.minutes-down', true).first().on('click', this.onDecrementMinutes, this); this.pop.select('button.period', true).first().on('click', this.onTogglePeriod, this); this.pop.select('button.ok', true).first().on('click', this.setTime, this); @@ -126,7 +126,7 @@ picker : function() { - return this.el.select('.datepicker', true).first(); + return this.pickerEl; }, fillTime: function() @@ -147,8 +147,8 @@ cls: 'btn', cn: [ { - tag: 'span', - cls: 'hours-up glyphicon glyphicon-chevron-up' + tag: 'i', + cls: 'hours-up fa fas fa-chevron-up' } ] } @@ -167,8 +167,8 @@ cls: 'btn', cn: [ { - tag: 'span', - cls: 'minutes-up glyphicon glyphicon-chevron-up' + tag: 'i', + cls: 'minutes-up fa fas fa-chevron-up' } ] } @@ -241,7 +241,7 @@ cn: [ { tag: 'span', - cls: 'hours-down glyphicon glyphicon-chevron-down' + cls: 'hours-down fa fas fa-chevron-down' } ] } @@ -261,7 +261,7 @@ cn: [ { tag: 'span', - cls: 'minutes-down glyphicon glyphicon-chevron-down' + cls: 'minutes-down fa fas fa-chevron-down' } ] } @@ -341,7 +341,9 @@ 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'){ @@ -445,47 +447,6 @@ }); -Roo.apply(Roo.bootstrap.TimeField, { - - content : { - tag: 'tbody', - cn: [ - { - tag: 'tr', - cn: [ - { - tag: 'td', - colspan: '7' - } - ] - } - ] - }, - - footer : { - tag: 'tfoot', - cn: [ - { - tag: 'tr', - cn: [ - { - tag: 'th', - colspan: '7', - cls: '', - cn: [ - { - tag: 'button', - cls: 'btn btn-info ok', - html: 'OK' - } - ] - } - - ] - } - ] - } -}); Roo.apply(Roo.bootstrap.TimeField, { @@ -501,9 +462,44 @@ tag: 'table', cls: 'table-condensed', cn:[ - Roo.bootstrap.TimeField.content, - Roo.bootstrap.TimeField.footer - ] + { + tag: 'tbody', + cn: [ + { + tag: 'tr', + cn: [ + { + tag: 'td', + colspan: '7' + } + ] + } + ] + }, + { + tag: 'tfoot', + cn: [ + { + tag: 'tr', + cn: [ + { + tag: 'th', + colspan: '7', + cls: '', + cn: [ + { + tag: 'button', + cls: 'btn btn-info ok', + html: 'OK' + } + ] + } + + ] + } + ] + } + ] } ] } -- 2.39.2