Calendar: Use shift and ctrl key as modifier for page up / down

This commit is contained in:
Felix Nagel 2016-04-13 22:19:01 +02:00
parent 280cda31d0
commit f2bbea2cec

View File

@ -123,15 +123,17 @@ return $.widget( "ui.calendar", {
}, },
_handleKeydown: function( event ) { _handleKeydown: function( event ) {
var pageAltKey = ( event.altKey || event.ctrlKey && event.shiftKey );
switch ( event.keyCode ) { switch ( event.keyCode ) {
case $.ui.keyCode.ENTER: case $.ui.keyCode.ENTER:
this.activeDescendant.mousedown(); this.activeDescendant.mousedown();
return; return;
case $.ui.keyCode.PAGE_UP: case $.ui.keyCode.PAGE_UP:
this.date.adjust( event.altKey ? "Y" : "M", -1 ); this.date.adjust( pageAltKey ? "Y" : "M", -1 );
break; break;
case $.ui.keyCode.PAGE_DOWN: case $.ui.keyCode.PAGE_DOWN:
this.date.adjust( event.altKey ? "Y" : "M", 1 ); this.date.adjust( pageAltKey ? "Y" : "M", 1 );
break; break;
case $.ui.keyCode.END: case $.ui.keyCode.END:
this.date.setDay( this.date.daysInMonth() ); this.date.setDay( this.date.daysInMonth() );