|
931 | 931 |
|
932 | 932 | box = createDom().hide(); |
933 | 933 | box.append('<div class="date-range-length-tip"></div>'); |
934 | | - box.delegate('.day', 'mouseleave', function() |
935 | | - { |
936 | | - box.find('.date-range-length-tip').hide(); |
937 | | - if (opt.singleDate) { |
938 | | - clearHovering(); |
939 | | - } |
940 | | - }); |
941 | 934 |
|
942 | 935 | $(opt.container).append(box); |
943 | 936 |
|
|
1072 | 1065 | showSelectedDays(); |
1073 | 1066 | } |
1074 | 1067 |
|
1075 | | - box.delegate('.day','click', function(evt) |
1076 | | - { |
1077 | | - dayClicked($(this)); |
1078 | | - }); |
1079 | | - |
1080 | | - box.delegate('.day','mouseenter',function(evt) |
1081 | | - { |
1082 | | - dayHovering($(this)); |
1083 | | - }); |
1084 | | - |
1085 | | - box.delegate('.week-number', 'click', function(evt) |
1086 | | - { |
1087 | | - weekNumberClicked($(this)); |
1088 | | - }); |
1089 | | - |
1090 | 1068 | box.attr('unselectable', 'on') |
1091 | 1069 | .css('user-select', 'none') |
1092 | 1070 | .bind('selectstart', function(e) |
|
2003 | 1981 | box.find('.'+month+' tbody').html(createMonthHTML(date)); |
2004 | 1982 | opt[month] = date; |
2005 | 1983 | updateSelectableRange(); |
| 1984 | + bindDayEvents(); |
| 1985 | + } |
| 1986 | + |
| 1987 | + function bindDayEvents() |
| 1988 | + { |
| 1989 | + box.find('.day').unbind("click").click(function (evt) { |
| 1990 | + dayClicked($(this)); |
| 1991 | + }); |
| 1992 | + |
| 1993 | + box.find('.day').unbind("mouseenter").mouseenter(function (evt) { |
| 1994 | + dayHovering($(this)); |
| 1995 | + }); |
| 1996 | + |
| 1997 | + box.find('.day').unbind("mouseleave").mouseleave(function (evt) { |
| 1998 | + box.find('.date-range-length-tip').hide(); |
| 1999 | + if (opt.singleDate) { |
| 2000 | + clearHovering(); |
| 2001 | + } |
| 2002 | + }); |
| 2003 | + |
| 2004 | + box.find('.week-number').unbind("click").click(function (evt) { |
| 2005 | + weekNumberClicked($(this)); |
| 2006 | + }); |
2006 | 2007 | } |
2007 | 2008 |
|
2008 | 2009 | function showTime(date,name) |
|
0 commit comments