@@ -799,12 +799,16 @@ $.extend(Datepicker.prototype, {
799
799
datepicker_instActive = inst ; // for delegate hover events
800
800
inst . dpDiv . empty ( ) . append ( this . _generateHTML ( inst ) ) ;
801
801
this . _attachHandlers ( inst ) ;
802
- inst . dpDiv . find ( "." + this . _dayOverClass + " a" ) ;
803
802
804
803
var origyearshtml ,
805
804
numMonths = this . _getNumberOfMonths ( inst ) ,
806
805
cols = numMonths [ 1 ] ,
807
- width = 17 ;
806
+ width = 17 ,
807
+ activeCell = inst . dpDiv . find ( "." + this . _dayOverClass + " a" ) ;
808
+
809
+ if ( activeCell . length > 0 ) {
810
+ datepicker_handleMouseover . apply ( activeCell . get ( 0 ) ) ;
811
+ }
808
812
809
813
inst . dpDiv . removeClass ( "ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4" ) . width ( "" ) ;
810
814
if ( cols > 1 ) {
@@ -2000,18 +2004,20 @@ function datepicker_bindHover(dpDiv) {
2000
2004
$ ( this ) . removeClass ( "ui-datepicker-next-hover" ) ;
2001
2005
}
2002
2006
} )
2003
- . delegate ( selector , "mouseover" , function ( ) {
2004
- if ( ! $ . datepicker . _isDisabledDatepicker ( datepicker_instActive . inline ? dpDiv . parent ( ) [ 0 ] : datepicker_instActive . input [ 0 ] ) ) {
2005
- $ ( this ) . parents ( ".ui-datepicker-calendar" ) . find ( "a" ) . removeClass ( "ui-state-hover" ) ;
2006
- $ ( this ) . addClass ( "ui-state-hover" ) ;
2007
- if ( this . className . indexOf ( "ui-datepicker-prev" ) !== - 1 ) {
2008
- $ ( this ) . addClass ( "ui-datepicker-prev-hover" ) ;
2009
- }
2010
- if ( this . className . indexOf ( "ui-datepicker-next" ) !== - 1 ) {
2011
- $ ( this ) . addClass ( "ui-datepicker-next-hover" ) ;
2012
- }
2013
- }
2014
- } ) ;
2007
+ . delegate ( selector , "mouseover" , datepicker_handleMouseover ) ;
2008
+ }
2009
+
2010
+ function datepicker_handleMouseover ( ) {
2011
+ if ( ! $ . datepicker . _isDisabledDatepicker ( datepicker_instActive . inline ? datepicker_instActive . dpDiv . parent ( ) [ 0 ] : datepicker_instActive . input [ 0 ] ) ) {
2012
+ $ ( this ) . parents ( ".ui-datepicker-calendar" ) . find ( "a" ) . removeClass ( "ui-state-hover" ) ;
2013
+ $ ( this ) . addClass ( "ui-state-hover" ) ;
2014
+ if ( this . className . indexOf ( "ui-datepicker-prev" ) !== - 1 ) {
2015
+ $ ( this ) . addClass ( "ui-datepicker-prev-hover" ) ;
2016
+ }
2017
+ if ( this . className . indexOf ( "ui-datepicker-next" ) !== - 1 ) {
2018
+ $ ( this ) . addClass ( "ui-datepicker-next-hover" ) ;
2019
+ }
2020
+ }
2015
2021
}
2016
2022
2017
2023
/* jQuery extend now ignores nulls! */
0 commit comments