mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Datepicker: Don't use .delegate(). Fixes #7470 - Datepicker: 1.8.x can't be used with jQuery 1.3.2 due to use of .delegate().
This commit is contained in:
parent
d3ffacb756
commit
4d8529cf84
27
ui/jquery.ui.datepicker.js
vendored
27
ui/jquery.ui.datepicker.js
vendored
@ -1727,18 +1727,23 @@ $.extend(Datepicker.prototype, {
|
||||
*/
|
||||
function bindHover(dpDiv) {
|
||||
var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a';
|
||||
return dpDiv.delegate(selector, 'mouseout', function() {
|
||||
$(this).removeClass('ui-state-hover');
|
||||
if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover');
|
||||
if (this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover');
|
||||
})
|
||||
.delegate(selector, 'mouseover', function(){
|
||||
if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) {
|
||||
$(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');
|
||||
$(this).addClass('ui-state-hover');
|
||||
if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover');
|
||||
if (this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover');
|
||||
return dpDiv.bind('mouseout', function(event) {
|
||||
var elem = $( event.target ).closest( selector );
|
||||
if ( !elem.length ) {
|
||||
return;
|
||||
}
|
||||
elem.removeClass( "ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover" );
|
||||
})
|
||||
.bind('mouseover', function(event) {
|
||||
var elem = $( event.target ).closest( selector );
|
||||
if ($.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0]) ||
|
||||
!elem.length ) {
|
||||
return;
|
||||
}
|
||||
elem.parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');
|
||||
elem.addClass('ui-state-hover');
|
||||
if (elem.hasClass('ui-datepicker-prev')) elem.addClass('ui-datepicker-prev-hover');
|
||||
if (elem.hasClass('ui-datepicker-next')) elem.addClass('ui-datepicker-next-hover');
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user