From: Felix Nagel Date: Sun, 27 Sep 2015 17:17:02 +0000 (+0200) Subject: Calendar: Remove _refresh method X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=66828b1a83675753c9f6f603236f897f62a215e6;p=jquery-ui.git Calendar: Remove _refresh method --- diff --git a/ui/widgets/calendar.js b/ui/widgets/calendar.js index 63b09ede3..1cdb07fdb 100644 --- a/ui/widgets/calendar.js +++ b/ui/widgets/calendar.js @@ -86,12 +86,14 @@ return $.widget( "ui.calendar", { "click .ui-calendar-prev": function( event ) { event.preventDefault(); this.date.adjust( "M", -this.options.numberOfMonths ); - this._refresh(); + this.viewDate.setTime( this.date.date().getTime() ); + this.refresh(); }, "click .ui-calendar-next": function( event ) { event.preventDefault(); this.date.adjust( "M", this.options.numberOfMonths ); - this._refresh(); + this.viewDate.setTime( this.date.date().getTime() ); + this.refresh(); }, "mousedown .ui-calendar-calendar button": function( event ) { event.preventDefault(); @@ -156,7 +158,8 @@ return $.widget( "ui.calendar", { ); this.refresh(); } else { - this._refresh(); + this.viewDate.setTime( this.date.date().getTime() ); + this.refresh(); } this.grid.focus(); } @@ -491,11 +494,6 @@ return $.widget( "ui.calendar", { this.buttonPane.appendTo( this.element ); }, - _refresh: function() { - this.viewDate.setTime( this.date.date().getTime() ); - this.refresh(); - }, - // Refreshing the entire calendar during interaction confuses screen readers, specifically // because the grid heading is marked up as a live region and will often not update if it's // destroyed and recreated instead of just having its text change. Additionally, interacting @@ -648,7 +646,8 @@ return $.widget( "ui.calendar", { this.viewDate.setAttributes( this._calendarDateOptions ); } if ( refresh ) { - this._refresh(); + this.viewDate.setTime( this.date.date().getTime() ); + this.refresh(); } },