Fix #6464 - card header
[roojs1] / Roo / bootstrap / MonthField.js
index 7ce79a2..9348c26 100644 (file)
@@ -37,9 +37,10 @@ Roo.bootstrap.MonthField = function(config){
         hide : true,
         /**
          * @event select
-         * Fires when select a month.
+         * Fires when select a date.
          * @param {Roo.bootstrap.MonthField} this
-         * @param {String} month The value of field
+         * @param {String} oldvalue The old value
+         * @param {String} newvalue The new value
          */
         select : true
     });
@@ -88,12 +89,14 @@ Roo.extend(Roo.bootstrap.MonthField, Roo.bootstrap.Input,  {
     
     setValue: function(v, suppressEvent)
     {   
+        var o = this.getValue();
+        
         Roo.bootstrap.MonthField.superclass.setValue.call(this, v);
         
         this.update();
 
         if(suppressEvent !== true){
-            this.fireEvent('select', this, v);
+            this.fireEvent('select', this, o, v);
         }
         
     },
@@ -147,7 +150,7 @@ Roo.extend(Roo.bootstrap.MonthField, Roo.bootstrap.Input,  {
                 tag: 'span',
                 cls: 'month',
                 html: Roo.bootstrap.MonthField.dates[this.language].monthsShort[i++]
-            }
+            };
             
             months.createChild(month);
         }
@@ -173,7 +176,9 @@ Roo.extend(Roo.bootstrap.MonthField, Roo.bootstrap.Input,  {
     
     place: function()
     {
-        if(this.isInline) return;
+        if(this.isInline) {
+            return;
+        }
         
         this.picker().removeClass(['bottom', 'top']);
         
@@ -223,7 +228,9 @@ Roo.extend(Roo.bootstrap.MonthField, Roo.bootstrap.Input,  {
     
     hide : function()
     {
-        if(this.isInline) return;
+        if(this.isInline) {
+            return;
+        }
         this.picker().hide();
         this.fireEvent('hide', this, this.date);
         
@@ -244,8 +251,9 @@ Roo.extend(Roo.bootstrap.MonthField, Roo.bootstrap.Input,  {
     fireKey: function(e)
     {
         if (!this.picker().isVisible()){
-            if (e.keyCode == 27) // allow escape to hide and re-show picker
+            if (e.keyCode == 27)   {// allow escape to hide and re-show picker
                 this.show();
+            }
             return;
         }