Skip to content

Commit b677f26

Browse files
committed
Calendar: Use _on for link hover events
1 parent aa57f82 commit b677f26

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ui/calendar.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,18 @@ return $.widget( "ui.calendar", {
6969
this._select( event, $( event.currentTarget ).data( "timestamp" ) );
7070
this.grid.focus( 1 );
7171
},
72+
"mouseenter .ui-calendar-header button, .ui-calendar-calendar a": "_hover",
73+
"mouseleave .ui-calendar-header button, .ui-calendar-calendar a": "_hover",
7274
"keydown .ui-calendar-calendar": "_handleKeydown"
7375
});
7476

75-
this.element.on( "mouseenter.calendar mouseleave.calendar", ".ui-calendar-header button, .ui-calendar-calendar a", function() {
76-
$( this ).toggleClass( "ui-state-hover" );
77-
});
78-
7977
this._createCalendar();
8078
},
8179

80+
_hover: function( event ) {
81+
$( event.currentTarget ).toggleClass( "ui-state-hover" );
82+
},
83+
8284
_handleKeydown: function( event ) {
8385

8486
// Only interested navigation keys

0 commit comments

Comments
 (0)