roojs-bootstrap.js
authorEdward <edward@roojs.com>
Fri, 21 Sep 2018 03:35:35 +0000 (11:35 +0800)
committerEdward <edward@roojs.com>
Fri, 21 Sep 2018 03:35:35 +0000 (11:35 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index d9f5818..4db33e6 100644 (file)
@@ -18858,16 +18858,16 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
         this.hide();
     },
     
-    show : function()
+    showPopup : function()
     {
         this.picker().show();
         this.update();
         this.place();
         
-        this.fireEvent('show', this, this.date);
+        this.fireEvent('showpopup', this, this.date);
     },
     
-    hide : function()
+    hidePopup : function()
     {
         if(this.isInline) {
             return;
@@ -18876,7 +18876,7 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
         this.viewMode = this.startViewMode;
         this.showMode();
         
-        this.fireEvent('hide', this, this.date);
+        this.fireEvent('hidepopup', this, this.date);
         
     },
     
@@ -19319,23 +19319,6 @@ Roo.extend(Roo.bootstrap.DateField, Roo.bootstrap.Input,  {
         this.date = this.viewDate = '';
         
         Roo.bootstrap.DateField.superclass.setValue.call(this, '');
-    },
-    
-    setVisible : function(visible)
-    {
-        if(!this.getEl()){
-            return;
-        }
-        
-        this.getEl().removeClass('hidden');
-        
-        if(visible){
-            this.fireEvent('show', this);
-            return;
-        }
-        
-        this.getEl().addClass('hidden');
-        this.fireEvent('hide', this);
     }
    
 });
index 182c238..c540c29 100644 (file)
@@ -772,8 +772,8 @@ A-=1;for(var i=-1;i<11;i++){this.picker().select('>.datepicker-years tbody td',t
 }this.picker().removeClass(['bottom','top']);if((Roo.lib.Dom.getViewHeight()+Roo.get(document.body).getScroll().top)-(this.inputEl().getBottom()+this.picker().getHeight())<0){this.picker().addClass('top');this.picker().setTop(this.inputEl().getTop()-this.picker().getHeight()).setLeft(this.inputEl().getLeft());
 return;}this.picker().addClass('bottom');this.picker().setTop(this.inputEl().getBottom()).setLeft(this.inputEl().getLeft());},parseDate:function(A){if(!A||A instanceof Date){return A;}var v=Date.parseDate(A,this.format);if(!v&&(this.useIso||A.match(/^(\d{4})-0?(\d+)-0?(\d+)/))){v=Date.parseDate(A,'Y-m-d');
 }if(!v&&this.altFormats){if(!this.altFormatsArray){this.altFormatsArray=this.altFormats.split("|");}for(var i=0,B=this.altFormatsArray.length;i<B&&!v;i++){v=Date.parseDate(A,this.altFormatsArray[i]);}}return v;},formatDate:function(A,B){return (!A||!(A instanceof Date))?A:A.dateFormat(B||this.format);
-},onFocus:function(){Roo.bootstrap.DateField.superclass.onFocus.call(this);this.show();},onBlur:function(){Roo.bootstrap.DateField.superclass.onBlur.call(this);var d=this.inputEl().getValue();this.setValue(d);this.hide();},show:function(){this.picker().show();
-this.update();this.place();this.fireEvent('show',this,this.date);},hide:function(){if(this.isInline){return;}this.picker().hide();this.viewMode=this.startViewMode;this.showMode();this.fireEvent('hide',this,this.date);},onMousedown:function(e){e.stopPropagation();
+},onFocus:function(){Roo.bootstrap.DateField.superclass.onFocus.call(this);this.show();},onBlur:function(){Roo.bootstrap.DateField.superclass.onBlur.call(this);var d=this.inputEl().getValue();this.setValue(d);this.hide();},showPopup:function(){this.picker().show();
+this.update();this.place();this.fireEvent('showpopup',this,this.date);},hidePopup:function(){if(this.isInline){return;}this.picker().hide();this.viewMode=this.startViewMode;this.showMode();this.fireEvent('hidepopup',this,this.date);},onMousedown:function(e){e.stopPropagation();
 e.preventDefault();},keyup:function(e){Roo.bootstrap.DateField.superclass.keyup.call(this);this.update();},setValue:function(v){if(this.fireEvent('beforeselect',this,v)!==false){var d=new Date(this.parseDate(v)).clearTime();if(isNaN(d.getTime())){this.date=this.viewDate='';
 Roo.bootstrap.DateField.superclass.setValue.call(this,'');return;}v=this.formatDate(d);Roo.bootstrap.DateField.superclass.setValue.call(this,v);this.date=new Date(d.getTime()-d.getTimezoneOffset()*60000);this.update();this.fireEvent('select',this,this.date);
 }},getValue:function(){return this.formatDate(this.date);},fireKey:function(e){if(!this.picker().isVisible()){if(e.keyCode==27){this.show();}return;}var A=false,B,C,D,E,F;switch(e.keyCode){case 27:this.hide();e.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation){break;
@@ -796,9 +796,8 @@ if(this.startDate!==-Infinity){this.startDate=this.parseDate(this.startDate);}th
 }return C;},moveYear:function(A,B){return this.moveMonth(A,B*12);},dateWithinRange:function(A){return A>=this.startDate&&A<=this.endDate;},remove:function(){this.picker().remove();},validateValue:function(A){if(this.getVisibilityEl().hasClass('hidden')){return true;
 }if(A.length<1){if(this.allowBlank){return true;}return false;}if(A.length<this.minLength){return false;}if(A.length>this.maxLength){return false;}if(this.vtype){var vt=Roo.form.VTypes;if(!vt[this.vtype](A,this)){return false;}}if(typeof this.validator=="function"){var B=this.validator(A);
 if(B!==true){return false;}}if(this.regex&&!this.regex.test(A)){return false;}if(typeof(this.parseDate(A))=='undefined'){return false;}if(this.endDate!==Infinity&&this.parseDate(A).getTime()>this.endDate.getTime()){return false;}if(this.startDate!==-Infinity&&this.parseDate(A).getTime()<this.startDate.getTime()){return false;
-}return true;},reset:function(){this.date=this.viewDate='';Roo.bootstrap.DateField.superclass.setValue.call(this,'');},setVisible:function(A){if(!this.getEl()){return;}this.getEl().removeClass('hidden');if(A){this.fireEvent('show',this);return;}this.getEl().addClass('hidden');
-this.fireEvent('hide',this);}});Roo.apply(Roo.bootstrap.DateField,{head:{tag:'thead',cn:[{tag:'tr',cn:[{tag:'th',cls:'prev',html:'<i class="fa fa-arrow-left"/>'},{tag:'th',cls:'switch',colspan:'5'},{tag:'th',cls:'next',html:'<i class="fa fa-arrow-right"/>'}
-]}]},content:{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}]}]},footer:{tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'th',colspan:'7',cls:'today'}]}]},dates:{en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today"}
+}return true;},reset:function(){this.date=this.viewDate='';Roo.bootstrap.DateField.superclass.setValue.call(this,'');}});Roo.apply(Roo.bootstrap.DateField,{head:{tag:'thead',cn:[{tag:'tr',cn:[{tag:'th',cls:'prev',html:'<i class="fa fa-arrow-left"/>'},{tag:'th',cls:'switch',colspan:'5'}
+,{tag:'th',cls:'next',html:'<i class="fa fa-arrow-right"/>'}]}]},content:{tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:'7'}]}]},footer:{tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'th',colspan:'7',cls:'today'}]}]},dates:{en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today"}
 },modes:[{clsName:'days',navFnc:'Month',navStep:1},{clsName:'months',navFnc:'FullYear',navStep:1},{clsName:'years',navFnc:'FullYear',navStep:10}]});Roo.apply(Roo.bootstrap.DateField,{template:{tag:'div',cls:'datepicker dropdown-menu roo-dynamic',cn:[{tag:'div',cls:'datepicker-days',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.head,{tag:'tbody'}
 ,Roo.bootstrap.DateField.footer]}]},{tag:'div',cls:'datepicker-months',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.head,Roo.bootstrap.DateField.content,Roo.bootstrap.DateField.footer]}]},{tag:'div',cls:'datepicker-years',cn:[{tag:'table',cls:'table-condensed',cn:[Roo.bootstrap.DateField.head,Roo.bootstrap.DateField.content,Roo.bootstrap.DateField.footer]}
 ]}]}});