Calendar: Fix jscs errors after merging master

This commit is contained in:
Felix Nagel 2015-10-08 15:06:55 +02:00
parent 7e8b7234b2
commit 2fe43bbbe2
14 changed files with 159 additions and 152 deletions

View File

@ -65,6 +65,7 @@ test( "base structure", function() {
}
function step3() {
// Multi-month 2
element = $( "#calendar" ).calendar( { numberOfMonths: 2 } );
dp = element.calendar( "widget" );

View File

@ -20,6 +20,7 @@ test( "Check Sets and Gets", 4, function() {
equal( date.setFullDate( 2012, 9, 15 ).year(), 2012, "Set full date and retrieve year" );
equal( date.month(), 9, "Set full date and retrieve month" );
equal( date.day(), 15, "Set full date and retrieve day" );
// TODO Add setTime test
} );
@ -117,6 +118,7 @@ test( "Clone", 2, function() {
} );
test( "Days", 1, function() {
// TODO Needs work
var date = $.ui.date( null, attributes );
date.eachDay = function( day ) {

View File

@ -59,6 +59,7 @@ $.extend( $.ui.date.prototype, {
setDay: function( day ) {
var date = this.dateObject;
// FIXME: Why not to use .setDate?
this.dateObject = new Date( date.getFullYear(), date.getMonth(), day, date.getHours(),
date.getMinutes(), date.getSeconds() );

View File

@ -123,6 +123,7 @@ var widget = $.widget( "ui.datepicker", {
keydown: function( event ) {
switch ( event.keyCode ) {
case $.ui.keyCode.TAB:
// Waiting for close() will make popup hide too late, which breaks tab key behavior
this.calendar.hide();
this.close( event );
@ -173,6 +174,7 @@ var widget = $.widget( "ui.datepicker", {
_calendarEvents: {
focusout: function( event ) {
// use a timer to allow click to clear it and letting that
// handle the closing instead of opening again
// also allows tabbing inside the calendar without it closing
@ -186,6 +188,7 @@ var widget = $.widget( "ui.datepicker", {
mouseup: function() {
clearTimeout( this.closeTimer );
},
// TODO on TAB (or shift TAB), make sure it ends up on something useful in DOM order
keyup: function( event ) {
if ( event.keyCode === $.ui.keyCode.ESCAPE && this.calendar.is( ":visible" ) ) {