11/*
2- The jQuery UI Month Picker Version 3.0.0
2+ The jQuery UI Month Picker Version 3.0.1
33https://github.com/KidSysco/jquery-ui-month-picker/
44
55Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
@@ -14,9 +14,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414GNU General Public License for more details.
1515
1616You 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
1818<http://www.gnu.org/licenses/gpl-3.0.txt>.
19-
2019*/
2120
2221( function ( $ , window , document , Date ) {
@@ -167,7 +166,7 @@ along with this program. If not, see
167166 }
168167
169168 $ . MonthPicker = {
170- VERSION : '3.0.0 ' , // Added in version 2.4;
169+ VERSION : '3.0.1 ' , // Added in version 2.4;
171170 i18n : {
172171 year : 'Year' ,
173172 prevYear : 'Previous Year' ,
@@ -441,8 +440,8 @@ along with this program. If not, see
441440
442441 this . _buttons = $ ( 'a' , $table ) . jqueryUIButton ( ) ;
443442
444- _menu . on ( click , function ( event ) {
445- return false ;
443+ _menu . on ( 'mousedown' + _eventsNs , function ( event ) {
444+ event . preventDefault ( ) ;
446445 } ) ;
447446
448447 // Checks and initailizes Min/MaxMonth properties
@@ -542,7 +541,7 @@ along with this program. If not, see
542541 // Allow the user to prevent opening the menu.
543542 event = event || $ . Event ( ) ;
544543 if ( _event ( 'OnBeforeMenuOpen' , this ) ( event ) === false || event . isDefaultPrevented ( ) ) {
545- return false ;
544+ return ;
546545 }
547546
548547 this . _visible = true ;
@@ -561,8 +560,7 @@ along with this program. If not, see
561560 }
562561
563562 _openedInstance = this ;
564-
565- $ ( document ) . on ( click + this . uuid , $proxy ( this . Close , this ) )
563+ $ ( document ) . on ( 'mousedown' + _eventsNs + this . uuid , $proxy ( this . Close , this ) )
566564 . on ( 'keydown' + _eventsNs + this . uuid , $proxy ( this . _keyDown , this ) ) ;
567565
568566 // Trun off validation so that clicking one of the months
@@ -584,8 +582,6 @@ along with this program. If not, see
584582 } ) ;
585583 }
586584 }
587-
588- return false ;
589585 } ,
590586
591587 Close : function ( event ) {
@@ -609,7 +605,7 @@ along with this program. If not, see
609605 this . _visible = false ;
610606 _openedInstance = null ;
611607 $ ( document ) . off ( 'keydown' + _eventsNs + this . uuid )
612- . off ( click + this . uuid ) ;
608+ . off ( 'mousedown' + _eventsNs + this . uuid ) ;
613609
614610 this . Validate ( ) ;
615611 _elem . on ( 'blur' + _eventsNs , $proxy ( this . Validate , this ) ) ;
@@ -718,7 +714,10 @@ along with this program. If not, see
718714 $ ( this ) . insertAfter ( _elem ) ;
719715 }
720716 } )
721- . on ( click , $proxy ( this . Toggle , this ) ) ;
717+ . on ( click , $proxy ( this . Toggle , this ) )
718+ . on ( 'mousedown' + _eventsNs , function ( r ) {
719+ r . preventDefault ( ) ;
720+ } ) ;
722721
723722 if ( this . _removeOldBtn ) {
724723 _oldButton . remove ( ) ;
0 commit comments