1
1
/*
2
- The jQuery UI Month Picker Version 3.0.0
2
+ The jQuery UI Month Picker Version 3.0.1
3
3
https://github.com/KidSysco/jquery-ui-month-picker/
4
4
5
5
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
@@ -14,9 +14,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
14
GNU General Public License for more details.
15
15
16
16
You should have received a copy of the GNU General Public License
17
- along with this program. If not, see
17
+ along with this program. If not, see
18
18
<http://www.gnu.org/licenses/gpl-3.0.txt>.
19
-
20
19
*/
21
20
22
21
( function ( $ , window , document , Date ) {
@@ -167,7 +166,7 @@ along with this program. If not, see
167
166
}
168
167
169
168
$ . MonthPicker = {
170
- VERSION : '3.0.0 ' , // Added in version 2.4;
169
+ VERSION : '3.0.1 ' , // Added in version 2.4;
171
170
i18n : {
172
171
year : 'Year' ,
173
172
prevYear : 'Previous Year' ,
@@ -441,8 +440,8 @@ along with this program. If not, see
441
440
442
441
this . _buttons = $ ( 'a' , $table ) . jqueryUIButton ( ) ;
443
442
444
- _menu . on ( click , function ( event ) {
445
- return false ;
443
+ _menu . on ( 'mousedown' + _eventsNs , function ( event ) {
444
+ event . preventDefault ( ) ;
446
445
} ) ;
447
446
448
447
// Checks and initailizes Min/MaxMonth properties
@@ -542,7 +541,7 @@ along with this program. If not, see
542
541
// Allow the user to prevent opening the menu.
543
542
event = event || $ . Event ( ) ;
544
543
if ( _event ( 'OnBeforeMenuOpen' , this ) ( event ) === false || event . isDefaultPrevented ( ) ) {
545
- return false ;
544
+ return ;
546
545
}
547
546
548
547
this . _visible = true ;
@@ -561,8 +560,7 @@ along with this program. If not, see
561
560
}
562
561
563
562
_openedInstance = this ;
564
-
565
- $ ( document ) . on ( click + this . uuid , $proxy ( this . Close , this ) )
563
+ $ ( document ) . on ( 'mousedown' + _eventsNs + this . uuid , $proxy ( this . Close , this ) )
566
564
. on ( 'keydown' + _eventsNs + this . uuid , $proxy ( this . _keyDown , this ) ) ;
567
565
568
566
// Trun off validation so that clicking one of the months
@@ -584,8 +582,6 @@ along with this program. If not, see
584
582
} ) ;
585
583
}
586
584
}
587
-
588
- return false ;
589
585
} ,
590
586
591
587
Close : function ( event ) {
@@ -609,7 +605,7 @@ along with this program. If not, see
609
605
this . _visible = false ;
610
606
_openedInstance = null ;
611
607
$ ( document ) . off ( 'keydown' + _eventsNs + this . uuid )
612
- . off ( click + this . uuid ) ;
608
+ . off ( 'mousedown' + _eventsNs + this . uuid ) ;
613
609
614
610
this . Validate ( ) ;
615
611
_elem . on ( 'blur' + _eventsNs , $proxy ( this . Validate , this ) ) ;
@@ -718,7 +714,10 @@ along with this program. If not, see
718
714
$ ( this ) . insertAfter ( _elem ) ;
719
715
}
720
716
} )
721
- . on ( click , $proxy ( this . Toggle , this ) ) ;
717
+ . on ( click , $proxy ( this . Toggle , this ) )
718
+ . on ( 'mousedown' + _eventsNs , function ( r ) {
719
+ r . preventDefault ( ) ;
720
+ } ) ;
722
721
723
722
if ( this . _removeOldBtn ) {
724
723
_oldButton . remove ( ) ;
0 commit comments