]> source.dussan.org Git - jquery-ui.git/commitdiff
Calendar: Use _on for link hover events
authorFelix Nagel <info@felixnagel.com>
Sat, 30 Aug 2014 00:06:52 +0000 (02:06 +0200)
committerScott González <scott.gonzalez@gmail.com>
Thu, 29 Jan 2015 23:01:30 +0000 (18:01 -0500)
ui/calendar.js

index 370f70123131346d8792b2ee09b713f6d6afeb76..83d1fe96b3f3b8058c2285e2050fa35cf3c96639 100644 (file)
@@ -70,16 +70,20 @@ return $.widget( "ui.calendar", {
                                this._select( event, $( event.currentTarget ).data( "timestamp" ) );
                                this.grid.focus();
                        },
+                       "mouseenter .ui-calendar-header button": "_hover",
+                       "mouseleave .ui-calendar-header button": "_hover",
+                       "mouseenter .ui-calendar-calendar a": "_hover",
+                       "mouseleave .ui-calendar-calendar a": "_hover",
                        "keydown .ui-calendar-calendar": "_handleKeydown"
                });
 
-               this.element.on( "mouseenter.calendar mouseleave.calendar", ".ui-calendar-header button, .ui-calendar-calendar a", function() {
-                       $( this ).toggleClass( "ui-state-hover" );
-               });
-
                this._createCalendar();
        },
 
+       _hover: function( event ) {
+               $( event.currentTarget ).toggleClass( "ui-state-hover" );
+       },
+
        _handleKeydown: function( event ) {
                var oldMonth = this.date.month(),
                        oldYear = this.date.year();