]> source.dussan.org Git - jquery-ui.git/commitdiff
Calendar: Remove _refresh method
authorFelix Nagel <info@felixnagel.com>
Sun, 27 Sep 2015 17:17:02 +0000 (19:17 +0200)
committerFelix Nagel <info@felixnagel.com>
Wed, 7 Oct 2015 22:18:48 +0000 (00:18 +0200)
ui/widgets/calendar.js

index 63b09ede3e3e4ffc31bb659e6d0cbc06edf57d85..1cdb07fdb4858c80f8c23717a9852cd78209abe2 100644 (file)
@@ -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();
                }
        },