From: Alan Knowles Date: Mon, 8 Feb 2021 02:31:21 +0000 (+0800) Subject: roojs-bootstrap.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=ee762f1e6aa524708b2ec95d726264aa48a27dca roojs-bootstrap.js roojs-bootstrap-debug.js --- diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index f6d3c2c6f5..343414b342 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -21990,10 +21990,10 @@ Roo.extend(Roo.bootstrap.TimeField, Roo.bootstrap.Input, { 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); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 90c055e020..8b1953f7bf 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -920,8 +920,8 @@ if(B!==true){return false;}}if(this.regex&&!this.regex.test(A)){return false;}if Roo.bootstrap.TimeField=function(A){Roo.bootstrap.TimeField.superclass.constructor.call(this,A);this.addEvents({show:true,hide:true,select:true});};Roo.extend(Roo.bootstrap.TimeField,Roo.bootstrap.Input,{format:"H:i",getAutoCreate:function(){this.after=''; return Roo.bootstrap.TimeField.superclass.getAutoCreate.call(this);},onRender:function(ct,A){Roo.bootstrap.TimeField.superclass.onRender.call(this,ct,A);this.el.select('.input-group',true).first().createChild(Roo.bootstrap.TimeField.template);this.picker().setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block'; this.pop=this.picker().select('>.datepicker-time',true).first();this.pop.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.picker().on('mousedown',this.onMousedown,this);this.picker().on('click',this.onClick,this);this.picker().addClass('datepicker-dropdown'); -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('button.period',true).first().on('click',this.onTogglePeriod,this);this.pop.select('button.ok',true).first().on('click',this.setTime,this);},fireKey:function(e){if(!this.picker().isVisible()){if(e.keyCode==27){this.show(); +this.fillTime();this.update();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);},fireKey:function(e){if(!this.picker().isVisible()){if(e.keyCode==27){this.show(); }return;}e.preventDefault();switch(e.keyCode){case 27:this.hide();break;case 37:case 39:this.onTogglePeriod();break;case 38:this.onIncrementMinutes();break;case 40:this.onDecrementMinutes();break;case 13:case 9:this.setTime();break;}},onClick:function(e){e.stopPropagation(); e.preventDefault();},picker:function(){return this.el.select('.datepicker',true).first();},fillTime:function(){var A=this.pop.select('tbody',true).first();A.dom.innerHTML='';A.createChild({tag:'tr',cn:[{tag:'td',cn:[{tag:'a',href:'#',cls:'btn',cn:[{tag:'i',cls:'hours-up fa fas fa-chevron-up'} ]}]},{tag:'td',cls:'separator'},{tag:'td',cn:[{tag:'a',href:'#',cls:'btn',cn:[{tag:'i',cls:'minutes-up fa fas fa-chevron-up'}]}]},{tag:'td',cls:'separator'}]});A.createChild({tag:'tr',cn:[{tag:'td',cn:[{tag:'span',cls:'timepicker-hour',html:'00'}]},{tag:'td',cls:'separator',html:':'}